Player: Loading chunks to spawn entities is a bug

again, this would never happen except in bug circumstances, but if there was a bug, it should crash instead of trying to load chunks to paper over it.
This commit is contained in:
Dylan K. Taylor 2020-09-20 13:40:44 +01:00
parent 7f43164776
commit b7471fc77b

View File

@ -747,7 +747,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
}
protected function spawnEntitiesOnChunk(int $chunkX, int $chunkZ) : void{
foreach($this->getWorld()->getOrLoadChunk($chunkX, $chunkZ)->getEntities() as $entity){
foreach($this->getWorld()->getChunk($chunkX, $chunkZ)->getEntities() as $entity){
if($entity !== $this and !$entity->isFlaggedForDespawn()){
$entity->spawnTo($this);
}