mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
changed chunk loading a little bit
This commit is contained in:
parent
1a6f30526f
commit
532acb549d
1 changed files with 9 additions and 9 deletions
|
|
@ -236,10 +236,10 @@ class Player{
|
||||||
$this->entity->resetSpeed();
|
$this->entity->resetSpeed();
|
||||||
$this->entity->updateLast();
|
$this->entity->updateLast();
|
||||||
$this->entity->calculateVelocity();
|
$this->entity->calculateVelocity();
|
||||||
if($terrain === true){
|
/*if($terrain === true){
|
||||||
$this->orderChunks();
|
$this->orderChunks();
|
||||||
$this->getNextChunk($this->level);
|
$this->getNextChunk($this->level);
|
||||||
}
|
}*/
|
||||||
$this->entity->check = true;
|
$this->entity->check = true;
|
||||||
if($force === true){
|
if($force === true){
|
||||||
$this->forceMovement = $pos;
|
$this->forceMovement = $pos;
|
||||||
|
|
@ -429,7 +429,7 @@ class Player{
|
||||||
asort($this->chunksOrder);
|
asort($this->chunksOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loaddAllChunks(){
|
public function loadAllChunks(){
|
||||||
for($x = 0; $x < 16; $x++){
|
for($x = 0; $x < 16; $x++){
|
||||||
for($z = 0; $z < 16; $z++){
|
for($z = 0; $z < 16; $z++){
|
||||||
$this->useChunk($x, $z);
|
$this->useChunk($x, $z);
|
||||||
|
|
@ -459,11 +459,9 @@ class Player{
|
||||||
}
|
}
|
||||||
|
|
||||||
$pk = new FullChunkDataPacket;
|
$pk = new FullChunkDataPacket;
|
||||||
$pk->buffer .= Utils::writeInt($X);
|
|
||||||
$pk->buffer .= Utils::writeInt($Z);
|
|
||||||
$pk->chunkX = $X;
|
$pk->chunkX = $X;
|
||||||
$pk->chunkZ = $Z;
|
$pk->chunkZ = $Z;
|
||||||
$pk->data = $this->level->getOrderedChunk($X, $Z, $Yndex);
|
$pk->data = $this->level->getOrderedFullChunk($X, $Z);
|
||||||
$cnt = $this->dataPacket($pk);
|
$cnt = $this->dataPacket($pk);
|
||||||
if($cnt === false){
|
if($cnt === false){
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1481,7 +1479,8 @@ class Player{
|
||||||
$pos = new Position($this->entity->x, $this->entity->y, $this->entity->z, $this->level);
|
$pos = new Position($this->entity->x, $this->entity->y, $this->entity->z, $this->level);
|
||||||
//}
|
//}
|
||||||
$pData = $this->data->get("position");
|
$pData = $this->data->get("position");
|
||||||
$this->teleport($pos, isset($pData["yaw"]) ? $pData["yaw"] : false, isset($pData["pitch"]) ? $pData["pitch"] : false, true, true);
|
$this->server->schedule(20, array($this, "teleport"), $pos);
|
||||||
|
//$this->teleport($pos, isset($pData["yaw"]) ? $pData["yaw"] : false, isset($pData["pitch"]) ? $pData["pitch"] : false, true, true);
|
||||||
$this->entity->setHealth($this->data->get("health"), "spawn", true);
|
$this->entity->setHealth($this->data->get("health"), "spawn", true);
|
||||||
$this->spawned = true;
|
$this->spawned = true;
|
||||||
$this->server->api->player->spawnAllPlayers($this);
|
$this->server->api->player->spawnAllPlayers($this);
|
||||||
|
|
@ -1501,7 +1500,8 @@ class Player{
|
||||||
/*$this->sendInventory();
|
/*$this->sendInventory();
|
||||||
$this->sendSettings();*/
|
$this->sendSettings();*/
|
||||||
$this->orderChunks();
|
$this->orderChunks();
|
||||||
$this->getNextChunk($this->level);
|
//$this->getNextChunk($this->level);
|
||||||
|
$this->loadAllChunks();
|
||||||
$this->blocked = false;
|
$this->blocked = false;
|
||||||
|
|
||||||
$this->server->handle("player.spawn", $this);
|
$this->server->handle("player.spawn", $this);
|
||||||
|
|
@ -1608,7 +1608,7 @@ class Player{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::REQUEST_CHUNK_PACKET:
|
case ProtocolInfo::REQUEST_CHUNK_PACKET:
|
||||||
//console("request x:".$packet->chunkX.", z: ".$packet->chunkZ." chunk");
|
console("request x:".$packet->chunkX.", z: ".$packet->chunkZ." chunk");
|
||||||
//$this->useChunk($packet->chunkX, $packet->chunkZ);
|
//$this->useChunk($packet->chunkX, $packet->chunkZ);
|
||||||
//$this->lastChunk = [$packet->chunkX, $packet->chunkZ];
|
//$this->lastChunk = [$packet->chunkX, $packet->chunkZ];
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue