mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
LightUpdate: allow providing effective light levels for propagation, fix #2999
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\world\light;
|
||||
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\world\World;
|
||||
use function max;
|
||||
|
||||
class SkyLightUpdate extends LightUpdate{
|
||||
@ -31,6 +32,14 @@ class SkyLightUpdate extends LightUpdate{
|
||||
$this->currentLightArray = $this->subChunkHandler->currentSubChunk->getBlockSkyLightArray();
|
||||
}
|
||||
|
||||
protected function getEffectiveLight(int $x, int $y, int $z) : int{
|
||||
if($y >= World::Y_MAX){
|
||||
$this->subChunkHandler->invalidate();
|
||||
return 15;
|
||||
}
|
||||
return parent::getEffectiveLight($x, $y, $z);
|
||||
}
|
||||
|
||||
public function recalculateNode(int $x, int $y, int $z) : void{
|
||||
$chunk = $this->world->getChunk($x >> 4, $z >> 4);
|
||||
if($chunk === null){
|
||||
|
Reference in New Issue
Block a user