diff --git a/src/world/World.php b/src/world/World.php index 49025b948..4d6cad154 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1727,14 +1727,10 @@ class World implements ChunkManager{ */ private function getHighestAdjacentLight(int $x, int $y, int $z, \Closure $lightGetter) : int{ $max = 0; - foreach([ - [$x + 1, $y, $z], - [$x - 1, $y, $z], - [$x, $y + 1, $z], - [$x, $y - 1, $z], - [$x, $y, $z + 1], - [$x, $y, $z - 1] - ] as [$x1, $y1, $z1]){ + foreach(Facing::OFFSET as [$offsetX, $offsetY, $offsetZ]){ + $x1 = $x + $offsetX; + $y1 = $y + $offsetY; + $z1 = $z + $offsetZ; if( !$this->isInWorld($x1, $y1, $z1) || ($chunk = $this->getChunk($x1 >> Chunk::COORD_BIT_SIZE, $z1 >> Chunk::COORD_BIT_SIZE)) === null ||