mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Give neighbour block updates its own timer
this way we aren't conflating them with scheduled updates, which are usually caused by e.g. water
This commit is contained in:
parent
41c5f63565
commit
af432c1a7f
@ -948,9 +948,7 @@ class World implements ChunkManager{
|
||||
$this->providerGarbageCollectionTicker = 0;
|
||||
}
|
||||
|
||||
//Do block updates
|
||||
$this->timings->scheduledBlockUpdates->startTiming();
|
||||
|
||||
//Delayed updates
|
||||
while($this->scheduledBlockUpdateQueue->count() > 0 && $this->scheduledBlockUpdateQueue->current()["priority"] <= $currentTick){
|
||||
/** @var Vector3 $vec */
|
||||
@ -962,7 +960,9 @@ class World implements ChunkManager{
|
||||
$block = $this->getBlock($vec);
|
||||
$block->onScheduledUpdate();
|
||||
}
|
||||
$this->timings->scheduledBlockUpdates->stopTiming();
|
||||
|
||||
$this->timings->neighbourBlockUpdates->startTiming();
|
||||
//Normal updates
|
||||
while($this->neighbourBlockUpdateQueue->count() > 0){
|
||||
$index = $this->neighbourBlockUpdateQueue->dequeue();
|
||||
@ -987,7 +987,7 @@ class World implements ChunkManager{
|
||||
$block->onNearbyBlockChange();
|
||||
}
|
||||
|
||||
$this->timings->scheduledBlockUpdates->stopTiming();
|
||||
$this->timings->neighbourBlockUpdates->stopTiming();
|
||||
|
||||
$this->timings->entityTick->startTiming();
|
||||
//Update entities that need update
|
||||
|
@ -34,6 +34,7 @@ class WorldTimings{
|
||||
|
||||
public TimingsHandler $doChunkUnload;
|
||||
public TimingsHandler $scheduledBlockUpdates;
|
||||
public TimingsHandler $neighbourBlockUpdates;
|
||||
public TimingsHandler $randomChunkUpdates;
|
||||
public TimingsHandler $randomChunkUpdatesChunkSelection;
|
||||
public TimingsHandler $doChunkGC;
|
||||
@ -77,6 +78,7 @@ class WorldTimings{
|
||||
|
||||
$this->doChunkUnload = self::newTimer($name, "Unload Chunks");
|
||||
$this->scheduledBlockUpdates = self::newTimer($name, "Scheduled Block Updates");
|
||||
$this->neighbourBlockUpdates = self::newTimer($name, "Neighbour Block Updates");
|
||||
$this->randomChunkUpdates = self::newTimer($name, "Random Chunk Updates");
|
||||
$this->randomChunkUpdatesChunkSelection = self::newTimer($name, "Random Chunk Updates - Chunk Selection");
|
||||
$this->doChunkGC = self::newTimer($name, "Garbage Collection");
|
||||
|
Loading…
x
Reference in New Issue
Block a user