diff --git a/src/Player.php b/src/Player.php index e9816947..e6ebdc6c 100755 --- a/src/Player.php +++ b/src/Player.php @@ -311,7 +311,7 @@ class Player{ $this->entity->calculateVelocity(); if($terrain === true){ $this->orderChunks(); - $this->getNextChunk($this->level); + if($this->spawned) $this->getNextChunk($this->level); } $this->entity->check = true; if($force === true){ @@ -575,7 +575,6 @@ class Player{ if($this->connected === false or $world != $this->level){ return false; } - foreach($this->chunkCount as $count => $t){ if(isset($this->recoveryQueue[$count]) or isset($this->resendQueue[$count])){ $this->server->schedule(MAX_CHUNK_RATE, [$this, "getNextChunk"], $world); @@ -1730,9 +1729,9 @@ class Player{ $pos = new Position($this->entity->x, $this->entity->y, $this->entity->z, $this->level); $pData = $this->data->get("position"); - $this->teleport($pos, $pData["yaw"] ?? false, $pData["pitch"] ?? false, true, true); $this->entity->setHealth($this->data->get("health"), "spawn", true, false); $this->spawned = true; + $this->teleport($pos, $pData["yaw"] ?? false, $pData["pitch"] ?? false, true, true); $this->server->api->player->spawnAllPlayers($this); $this->server->api->player->spawnToAllPlayers($this); $this->server->api->entity->spawnAll($this);