mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Merge pull request #3199 from alejandroliu/tile-fix-teleport-glitch-new
Teleport glitch fix
This commit is contained in:
commit
bfd3fb6636
@ -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]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user