mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-10 15:59:39 +00:00
Level: Allow tiles to be sent with regular block updates
This commit is contained in:
parent
eadb1d310e
commit
49f9605620
@ -855,9 +855,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
unset($this->updateTiles[$blockHash]);
|
||||
}
|
||||
if(!$tile->isClosed() and $tile instanceof Spawnable and $tile->isDirty()){
|
||||
$this->clearChunkCache($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
|
||||
//TODO: merge this with block-updating (it'll send useless data if a full-chunk resend happens)
|
||||
$this->broadcastPacketToViewers($tile, $tile->createSpawnPacket());
|
||||
$chunkHash = Level::chunkHash($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
|
||||
if(!isset($this->changedBlocks[$chunkHash])){
|
||||
$this->changedBlocks[$chunkHash] = [$blockHash => $tile];
|
||||
}else{
|
||||
$this->changedBlocks[$chunkHash][$blockHash] = $tile;
|
||||
}
|
||||
$tile->setDirty(false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user