From 75a4136ab2581c13c9cf2e538d758c978ff9e3b8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 25 Jun 2019 14:17:56 +0100 Subject: [PATCH] Player: fix bug in unloadChunk() causing entity artifacts on world change --- src/pocketmine/player/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/player/Player.php b/src/pocketmine/player/Player.php index 9429e51c5..066718122 100644 --- a/src/pocketmine/player/Player.php +++ b/src/pocketmine/player/Player.php @@ -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); }