mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
World: use Facing::OFFSET in getHighestAdjacentLight()
This commit is contained in:
parent
6ac45526f9
commit
1cf508abdb
@ -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 ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user