From 0723112207c28a4e792a0e0e51fbc839391b473b Mon Sep 17 00:00:00 2001 From: Alejandro Liu Date: Fri, 19 Jun 2015 21:06:15 +0200 Subject: [PATCH] Once again... --- src/pocketmine/Player.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 527cacc90..9b1db372c 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -620,6 +620,18 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade $entity->despawnFrom($this); } } + //TODO HACK: removes tile entities that linger whenever you teleport + // to a different world + $pk = new UpdateBlockPacket(); + foreach($level->getChunkTiles($x, $z) as $tile){ + if($tile instanceof Spawnable){ + $pk->records[] = [$tile->x, $tile->z, $tile->y, 0, 0, UpdateBlockPacket::FLAG_NONE]; + } + } + if(count($pk->records)){ + $this->dataPacket($pk); + } + //---- unset($this->usedChunks[$index]); }