mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
World: avoid triggering light updates when the target block light level/filter haven't changed
This commit is contained in:
parent
3eb1a56985
commit
ece28e5d7b
@ -1483,6 +1483,8 @@ class World implements ChunkManager{
|
||||
|
||||
$this->timings->setBlock->startTiming();
|
||||
|
||||
$oldBlock = $this->getBlockAt($x, $y, $z, true, false);
|
||||
|
||||
$block = clone $block;
|
||||
|
||||
$block->position($this, $x, $y, $z);
|
||||
@ -1503,7 +1505,9 @@ class World implements ChunkManager{
|
||||
}
|
||||
|
||||
if($update){
|
||||
$this->updateAllLight($block);
|
||||
if($oldBlock->getLightFilter() !== $block->getLightFilter() or $oldBlock->getLightLevel() !== $block->getLightLevel()){
|
||||
$this->updateAllLight($block);
|
||||
}
|
||||
$this->tryAddToNeighbourUpdateQueue($block);
|
||||
foreach($block->sides() as $side){
|
||||
$this->tryAddToNeighbourUpdateQueue($side);
|
||||
|
Loading…
x
Reference in New Issue
Block a user