Fixed players taking forever to spawn when generating a new world

This commit is contained in:
Dylan K. Taylor 2017-06-26 18:37:20 +01:00
parent ec079b68a6
commit 1dd8fc008b

View File

@ -852,11 +852,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->level->registerChunkLoader($this, $X, $Z, false);
if(!$this->level->populateChunk($X, $Z)){
if($this->spawned and $this->teleportPosition === null){
continue;
}else{
break;
}
continue;
}
unset($this->loadQueue[$index]);
@ -4192,6 +4188,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
public function onChunkChanged(Chunk $chunk){
if(isset($this->usedChunks[$hash = Level::chunkHash($chunk->getX(), $chunk->getZ())])){
$this->usedChunks[$hash] = false;
if(!$this->spawned){
$this->nextChunkOrderRun = 0;
}
}
}