diff --git a/src/world/World.php b/src/world/World.php index 93b2fa60d..f059f589b 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1826,7 +1826,7 @@ class World implements ChunkManager{ * @return int 0-15 */ public function getBlockSkyLightAt(int $x, int $y, int $z) : int{ - return $this->getOrLoadChunk($x >> 4, $z >> 4, true)->getBlockSkyLight($x & 0x0f, $y, $z & 0x0f); + return $this->getOrLoadChunk($x >> 4, $z >> 4, true)->getSubChunk($y >> 4)->getBlockSkyLightArray()->get($x & 0x0f, $y & 0xf, $z & 0x0f); } /** @@ -1835,7 +1835,7 @@ class World implements ChunkManager{ * @return int 0-15 */ public function getBlockLightAt(int $x, int $y, int $z) : int{ - return $this->getOrLoadChunk($x >> 4, $z >> 4, true)->getBlockLight($x & 0x0f, $y, $z & 0x0f); + return $this->getOrLoadChunk($x >> 4, $z >> 4, true)->getSubChunk($y >> 4)->getBlockLightArray()->get($x & 0x0f, $y & 0xf, $z & 0x0f); } public function getBiomeId(int $x, int $z) : int{ diff --git a/src/world/format/Chunk.php b/src/world/format/Chunk.php index 0010063e4..95e2afba5 100644 --- a/src/world/format/Chunk.php +++ b/src/world/format/Chunk.php @@ -156,68 +156,6 @@ class Chunk{ $this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN; } - /** - * Returns the sky light level at the specified chunk block coordinates - * - * @param int $x 0-15 - * @param int $y 0-255 - * @param int $z 0-15 - * - * @return int 0-15 - */ - public function getBlockSkyLight(int $x, int $y, int $z) : int{ - return $this->getSubChunk($y >> 4)->getBlockSkyLightArray()->get($x & 0xf, $y & 0x0f, $z & 0xf); - } - - /** - * Sets the sky light level at the specified chunk block coordinates - * - * @param int $x 0-15 - * @param int $y 0-255 - * @param int $z 0-15 - * @param int $level 0-15 - */ - public function setBlockSkyLight(int $x, int $y, int $z, int $level) : void{ - $this->getWritableSubChunk($y >> 4)->getBlockSkyLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); - } - - public function setAllBlockSkyLight(int $level) : void{ - for($y = $this->subChunks->count() - 1; $y >= 0; --$y){ - $this->getWritableSubChunk($y)->setBlockSkyLightArray(LightArray::fill($level)); - } - } - - /** - * Returns the block light level at the specified chunk block coordinates - * - * @param int $x 0-15 - * @param int $y 0-255 - * @param int $z 0-15 - * - * @return int 0-15 - */ - public function getBlockLight(int $x, int $y, int $z) : int{ - return $this->getSubChunk($y >> 4)->getBlockLightArray()->get($x & 0xf, $y & 0x0f, $z & 0xf); - } - - /** - * Sets the block light level at the specified chunk block coordinates - * - * @param int $x 0-15 - * @param int $y 0-255 - * @param int $z 0-15 - * @param int $level 0-15 - */ - public function setBlockLight(int $x, int $y, int $z, int $level) : void{ - $this->getWritableSubChunk($y >> 4)->getBlockLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); - } - - public function setAllBlockLight(int $level) : void{ - for($y = $this->subChunks->count() - 1; $y >= 0; --$y){ - $this->getWritableSubChunk($y)->setBlockLightArray(LightArray::fill($level)); - } - } - /** * Returns the Y coordinate of the highest non-air block at the specified X/Z chunk block coordinates *