mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Implemented #2556: don't send tile NBT updates until the end of tick
this eliminates spam when tile spawn NBT changes a lot during a tick, for example the lines of a sign being updated. closes #2556
This commit is contained in:
@ -798,6 +798,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(!$tile->onUpdate()){
|
||||
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());
|
||||
$tile->setDirty(false);
|
||||
}
|
||||
}
|
||||
Timings::$tickTileEntityTimer->stopTiming();
|
||||
$this->timings->tileEntityTick->stopTiming();
|
||||
@ -2587,10 +2593,6 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
$this->tiles[Level::blockHash($tile->x, $tile->y, $tile->z)] = $tile;
|
||||
$tile->scheduleUpdate();
|
||||
if($tile instanceof Spawnable){
|
||||
$this->clearChunkCache($chunkX, $chunkZ);
|
||||
$tile->spawnToAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user