mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-10 15:59:39 +00:00
World: do not include unloaded or unlit chunks in getHighestAdjacentBlock(Sky)Light()
This commit is contained in:
parent
3c892182fd
commit
b079772d32
@ -1232,7 +1232,11 @@ class World implements ChunkManager{
|
|||||||
[$x, $y, $z + 1],
|
[$x, $y, $z + 1],
|
||||||
[$x, $y, $z - 1]
|
[$x, $y, $z - 1]
|
||||||
] as [$x1, $y1, $z1]){
|
] as [$x1, $y1, $z1]){
|
||||||
if(!$this->isInWorld($x1, $y1, $z1)){
|
if(
|
||||||
|
!$this->isInWorld($x1, $y1, $z1) ||
|
||||||
|
($chunk = $this->getChunk($x1 >> 4, $z1 >> 4)) === null ||
|
||||||
|
!$chunk->isLightPopulated()
|
||||||
|
){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$max = max($max, $this->getBlockSkyLightAt($x1, $y1, $z1));
|
$max = max($max, $this->getBlockSkyLightAt($x1, $y1, $z1));
|
||||||
@ -1253,7 +1257,11 @@ class World implements ChunkManager{
|
|||||||
[$x, $y, $z + 1],
|
[$x, $y, $z + 1],
|
||||||
[$x, $y, $z - 1]
|
[$x, $y, $z - 1]
|
||||||
] as [$x1, $y1, $z1]){
|
] as [$x1, $y1, $z1]){
|
||||||
if(!$this->isInWorld($x1, $y1, $z1)){
|
if(
|
||||||
|
!$this->isInWorld($x1, $y1, $z1) ||
|
||||||
|
($chunk = $this->getChunk($x1 >> 4, $z1 >> 4)) === null ||
|
||||||
|
!$chunk->isLightPopulated()
|
||||||
|
){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$max = max($max, $this->getBlockLightAt($x1, $y1, $z1));
|
$max = max($max, $this->getBlockLightAt($x1, $y1, $z1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user