World: remove premature optimisation of setBlockAt() introduced by ece28e5d7b0d4c8d12a9477cdd1d3337277e892d

closes #4531
it turns out that letting the light updates themselves handle this is faster than trying to get in the way.
This commit is contained in:
Dylan K. Taylor 2021-11-01 02:34:44 +00:00
parent 9d30bc8b95
commit 616eb0050d
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1596,8 +1596,6 @@ class World implements ChunkManager{
$this->unlockChunk($chunkX, $chunkZ, null);
$oldBlock = $this->getBlockAt($x, $y, $z, true, false);
$block = clone $block;
$block->position($this, $x, $y, $z);
@ -1619,9 +1617,7 @@ class World implements ChunkManager{
}
if($update){
if($oldBlock->getLightFilter() !== $block->getLightFilter() or $oldBlock->getLightLevel() !== $block->getLightLevel()){
$this->updateAllLight($x, $y, $z);
}
$this->updateAllLight($x, $y, $z);
$this->tryAddToNeighbourUpdateQueue($pos);
foreach($pos->sides() as $side){
$this->tryAddToNeighbourUpdateQueue($side);