Player: fix bug in unloadChunk() causing entity artifacts on world change

This commit is contained in:
Dylan K. Taylor 2019-06-25 14:17:56 +01:00
parent de10e401bf
commit 75a4136ab2

View File

@ -866,7 +866,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
$world = $world ?? $this->world;
$index = World::chunkHash($x, $z);
if(isset($this->usedChunks[$index])){
foreach($this->getWorld()->getChunkEntities($x, $z) as $entity){
foreach($world->getChunkEntities($x, $z) as $entity){
if($entity !== $this){
$entity->despawnFrom($this);
}