From c06b4830d1cde63af0a770cb40e707e09db848fa Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 May 2019 15:36:54 +0100 Subject: [PATCH] Player: don't spawn entities on out-of-sync chunks on join, closes #2911 --- src/pocketmine/Player.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 1dcc52c83..45bdaebd4 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1086,7 +1086,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->noDamageTicks = 60; - foreach($this->usedChunks as $index => $c){ + foreach($this->usedChunks as $index => $hasSent){ + if(!$hasSent){ + continue; //this will happen when the chunk is ready to send + } Level::getXZ($index, $chunkX, $chunkZ); foreach($this->level->getChunkEntities($chunkX, $chunkZ) as $entity){ if($entity !== $this and !$entity->isClosed() and $entity->isAlive() and !$entity->isFlaggedForDespawn()){