diff --git a/src/pocketmine/level/light/LightUpdate.php b/src/pocketmine/level/light/LightUpdate.php index 8d1497ab3..fcd66bed8 100644 --- a/src/pocketmine/level/light/LightUpdate.php +++ b/src/pocketmine/level/light/LightUpdate.php @@ -76,7 +76,7 @@ abstract class LightUpdate{ $this->setLight($x, $y, $z, $newLevel); if($oldLevel < $newLevel){ //light increased $this->spreadVisited[$index] = true; - $this->spreadQueue->enqueue([$x, $y, $z]); + $this->spreadQueue->enqueue([$x, $y, $z, $newLevel]); }else{ //light removed $this->removalVisited[$index] = true; $this->removalQueue->enqueue([$x, $y, $z, $oldLevel]); @@ -106,12 +106,7 @@ abstract class LightUpdate{ } while(!$this->spreadQueue->isEmpty()){ - list($x, $y, $z) = $this->spreadQueue->dequeue(); - - $newAdjacentLight = $this->getLight($x, $y, $z); - if($newAdjacentLight <= 0){ - continue; - } + list($x, $y, $z, $newAdjacentLight) = $this->spreadQueue->dequeue(); $points = [ [$x + 1, $y, $z], @@ -146,7 +141,7 @@ abstract class LightUpdate{ }elseif($current >= $oldAdjacentLevel){ if(!isset($this->spreadVisited[$index = Level::blockHash($x, $y, $z)])){ $this->spreadVisited[$index] = true; - $this->spreadQueue->enqueue([$x, $y, $z]); + $this->spreadQueue->enqueue([$x, $y, $z, $current]); } } } @@ -161,7 +156,7 @@ abstract class LightUpdate{ if(!isset($this->spreadVisited[$index = Level::blockHash($x, $y, $z)])){ $this->spreadVisited[$index] = true; if($potentialLight > 1){ - $this->spreadQueue->enqueue([$x, $y, $z]); + $this->spreadQueue->enqueue([$x, $y, $z, $potentialLight]); } } }