mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 08:19:45 +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]);
|
unset($this->updateTiles[$blockHash]);
|
||||||
}
|
}
|
||||||
if(!$tile->isClosed() and $tile instanceof Spawnable and $tile->isDirty()){
|
if(!$tile->isClosed() and $tile instanceof Spawnable and $tile->isDirty()){
|
||||||
$this->clearChunkCache($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
|
$chunkHash = Level::chunkHash($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
|
||||||
//TODO: merge this with block-updating (it'll send useless data if a full-chunk resend happens)
|
if(!isset($this->changedBlocks[$chunkHash])){
|
||||||
$this->broadcastPacketToViewers($tile, $tile->createSpawnPacket());
|
$this->changedBlocks[$chunkHash] = [$blockHash => $tile];
|
||||||
|
}else{
|
||||||
|
$this->changedBlocks[$chunkHash][$blockHash] = $tile;
|
||||||
|
}
|
||||||
$tile->setDirty(false);
|
$tile->setDirty(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user