Player: don't spawn entities on out-of-sync chunks on join, closes #2911

This commit is contained in:
Dylan K. Taylor 2019-05-08 15:36:54 +01:00
parent 6d64ef8d74
commit c06b4830d1

View File

@ -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()){