Level: fix light removal bugs caused by 48a5eeb3a459cb90b302990d3f243a34b0bb7da0 and 19e68f98a707536866c33bb1e9fad9f7c280447d

BlockFactory::\$lightFilter and Block->getLightFilter() are not equivalent.
This commit is contained in:
Dylan K. Taylor 2018-10-19 18:52:42 +01:00
parent 7642298b4f
commit 93b8a6c44a

View File

@ -1418,7 +1418,7 @@ class Level implements ChunkManager, Metadatable{
$this->skyLightUpdate->setAndUpdateLight($x, $i, $z, 15);
}
}else{ //No heightmap change, block changed "underground"
$this->skyLightUpdate->setAndUpdateLight($x, $y, $z, max(0, $this->getHighestAdjacentBlockSkyLight($x, $y, $z) - $source->getLightFilter()));
$this->skyLightUpdate->setAndUpdateLight($x, $y, $z, max(0, $this->getHighestAdjacentBlockSkyLight($x, $y, $z) - BlockFactory::$lightFilter[($source->getId() << 4) | $source->getDamage()]));
}
$this->timings->doBlockSkyLightUpdates->stopTiming();
@ -1448,7 +1448,7 @@ class Level implements ChunkManager, Metadatable{
$this->timings->doBlockLightUpdates->startTiming();
$block = $this->getBlockAt($x, $y, $z);
$newLevel = max($block->getLightLevel(), $this->getHighestAdjacentBlockLight($x, $y, $z) - $block->getLightFilter());
$newLevel = max($block->getLightLevel(), $this->getHighestAdjacentBlockLight($x, $y, $z) - BlockFactory::$lightFilter[($block->getId() << 4) | $block->getDamage()]);
if($this->blockLightUpdate === null){
$this->blockLightUpdate = new BlockLightUpdate($this);