mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
LightUpdate: remove premature optimisation which breaks when mass-update lighting is used
when setBlockSkyLightArray/setBlockLightArray was used, currentLightArray would retain a reference to the old light array, which would cause false readings if SubChunkExplorer didn't move away from that subchunk and back. This causes a small degradation of performance, but I think it can be implemented differently anyway. This also fixes #3816.
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\light;
|
||||
|
||||
use pocketmine\world\format\LightArray;
|
||||
use pocketmine\world\utils\SubChunkExplorer;
|
||||
use pocketmine\world\utils\SubChunkExplorerStatus;
|
||||
use pocketmine\world\World;
|
||||
@ -47,8 +48,8 @@ class SkyLightUpdate extends LightUpdate{
|
||||
$this->directSkyLightBlockers = $directSkyLightBlockers;
|
||||
}
|
||||
|
||||
protected function updateLightArrayRef() : void{
|
||||
$this->currentLightArray = $this->subChunkExplorer->currentSubChunk->getBlockSkyLightArray();
|
||||
protected function getCurrentLightArray() : LightArray{
|
||||
return $this->subChunkExplorer->currentSubChunk->getBlockSkyLightArray();
|
||||
}
|
||||
|
||||
protected function getEffectiveLight(int $x, int $y, int $z) : int{
|
||||
|
Reference in New Issue
Block a user