diff --git a/src/world/format/EmptySubChunk.php b/src/world/format/EmptySubChunk.php index b28450b0a..e1bac9118 100644 --- a/src/world/format/EmptySubChunk.php +++ b/src/world/format/EmptySubChunk.php @@ -56,10 +56,10 @@ class EmptySubChunk implements SubChunkInterface{ } public function getBlockLightArray() : LightArray{ - return new LightArray(LightArray::ZERO); + return LightArray::fill(0); } public function getBlockSkyLightArray() : LightArray{ - return new LightArray(LightArray::FIFTEEN); + return LightArray::fill(15); } } diff --git a/src/world/format/LightArray.php b/src/world/format/LightArray.php index 38137b920..885e9ddc9 100644 --- a/src/world/format/LightArray.php +++ b/src/world/format/LightArray.php @@ -39,8 +39,8 @@ if(!defined(__NAMESPACE__ . '\FIFTEEN_NIBBLE_ARRAY')){ final class LightArray{ - public const ZERO = ZERO_NIBBLE_ARRAY; - public const FIFTEEN = FIFTEEN_NIBBLE_ARRAY; + private const ZERO = ZERO_NIBBLE_ARRAY; + private const FIFTEEN = FIFTEEN_NIBBLE_ARRAY; /** @var string */ private $data; diff --git a/src/world/format/SubChunk.php b/src/world/format/SubChunk.php index d4514403e..e9c4e6c5f 100644 --- a/src/world/format/SubChunk.php +++ b/src/world/format/SubChunk.php @@ -46,8 +46,8 @@ class SubChunk implements SubChunkInterface{ $this->defaultBlock = $default; $this->blockLayers = $blocks; - $this->skyLight = $skyLight ?? new LightArray(LightArray::FIFTEEN); - $this->blockLight = $blockLight ?? new LightArray(LightArray::ZERO); + $this->skyLight = $skyLight ?? LightArray::fill(15); + $this->blockLight = $blockLight ?? LightArray::fill(0); } public function isEmptyAuthoritative() : bool{