From a34573643fab5e4b7ae7f8527cdb22c5a2ac1c30 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 18 Apr 2017 14:14:19 +0100 Subject: [PATCH] Fixed transparent blocks filtering direct sky light --- src/pocketmine/level/Level.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index aacdd5f20..8edfa9935 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1338,10 +1338,15 @@ class Level implements ChunkManager, Metadatable{ if($yPlusOne === $oldHeightMap){ //Block changed directly beneath the heightmap. Check if a block was removed or changed to a different light-filter. $newHeightMap = $this->getChunk($x >> 4, $z >> 4)->recalculateHeightMapColumn($x & 0x0f, $z & 0x0f); - }elseif($yPlusOne > $oldHeightMap){ //Block **placed** above the heightmap. - $this->setHeightMap($x, $z, $yPlusOne); - $newHeightMap = $yPlusOne; - }else{ //block changed below heightmap + }elseif($yPlusOne > $oldHeightMap){ //Block changed above the heightmap. + if(Block::$lightFilter[$sourceId] > 1 or Block::$diffusesSkyLight[$sourceId]){ + $this->setHeightMap($x, $z, $yPlusOne); + $newHeightMap = $yPlusOne; + }else{ //Block changed which has no effect on direct sky light, for example placing or removing glass. + $this->timings->doBlockSkyLightUpdates->stopTiming(); + return; + } + }else{ //Block changed below heightmap $newHeightMap = $oldHeightMap; }