diff --git a/src/pocketmine/world/format/Chunk.php b/src/pocketmine/world/format/Chunk.php index cf76026cf7..2c7b345407 100644 --- a/src/pocketmine/world/format/Chunk.php +++ b/src/pocketmine/world/format/Chunk.php @@ -202,7 +202,7 @@ class Chunk{ * @return int 0-15 */ public function getBlockSkyLight(int $x, int $y, int $z) : int{ - return $this->getSubChunk($y >> 4)->getBlockSkyLight($x, $y & 0x0f, $z); + return $this->getSubChunk($y >> 4)->getBlockSkyLightArray()->get($x & 0xf, $y & 0x0f, $z & 0xf); } /** @@ -214,7 +214,7 @@ class Chunk{ * @param int $level 0-15 */ public function setBlockSkyLight(int $x, int $y, int $z, int $level) : void{ - $this->getSubChunk($y >> 4, true)->setBlockSkyLight($x, $y & 0x0f, $z, $level); + $this->getSubChunk($y >> 4, true)->getBlockSkyLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); } /** @@ -238,7 +238,7 @@ class Chunk{ * @return int 0-15 */ public function getBlockLight(int $x, int $y, int $z) : int{ - return $this->getSubChunk($y >> 4)->getBlockLight($x, $y & 0x0f, $z); + return $this->getSubChunk($y >> 4)->getBlockLightArray()->get($x & 0xf, $y & 0x0f, $z & 0xf); } /** @@ -250,7 +250,7 @@ class Chunk{ * @param int $level 0-15 */ public function setBlockLight(int $x, int $y, int $z, int $level) : void{ - $this->getSubChunk($y >> 4, true)->setBlockLight($x, $y & 0x0f, $z, $level); + $this->getSubChunk($y >> 4, true)->getBlockLightArray()->set($x & 0xf, $y & 0x0f, $z & 0xf, $level); } /** diff --git a/src/pocketmine/world/format/EmptySubChunk.php b/src/pocketmine/world/format/EmptySubChunk.php index 2d5962b2c0..dae6048387 100644 --- a/src/pocketmine/world/format/EmptySubChunk.php +++ b/src/pocketmine/world/format/EmptySubChunk.php @@ -51,22 +51,6 @@ class EmptySubChunk implements SubChunkInterface{ return []; } - public function getBlockLight(int $x, int $y, int $z) : int{ - return 0; - } - - public function setBlockLight(int $x, int $y, int $z, int $level) : bool{ - return false; - } - - public function getBlockSkyLight(int $x, int $y, int $z) : int{ - return 15; - } - - public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool{ - return false; - } - public function getHighestBlockAt(int $x, int $z) : int{ return -1; } diff --git a/src/pocketmine/world/format/SubChunk.php b/src/pocketmine/world/format/SubChunk.php index dd7f228f1b..2f003ec8c0 100644 --- a/src/pocketmine/world/format/SubChunk.php +++ b/src/pocketmine/world/format/SubChunk.php @@ -90,26 +90,6 @@ class SubChunk implements SubChunkInterface{ return $this->blockLayers; } - public function getBlockLight(int $x, int $y, int $z) : int{ - return $this->blockLight->get($x, $y, $z); - } - - public function setBlockLight(int $x, int $y, int $z, int $level) : bool{ - $this->blockLight->set($x, $y, $z, $level); - - return true; - } - - public function getBlockSkyLight(int $x, int $y, int $z) : int{ - return $this->skyLight->get($x, $y, $z); - } - - public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool{ - $this->skyLight->set($x, $y, $z, $level); - - return true; - } - public function getHighestBlockAt(int $x, int $z) : int{ if(empty($this->blockLayers)){ return -1; diff --git a/src/pocketmine/world/format/SubChunkInterface.php b/src/pocketmine/world/format/SubChunkInterface.php index bb7c5f01d2..236a50aeb1 100644 --- a/src/pocketmine/world/format/SubChunkInterface.php +++ b/src/pocketmine/world/format/SubChunkInterface.php @@ -54,44 +54,6 @@ interface SubChunkInterface{ */ public function getBlockLayers() : array; - /** - * @param int $x - * @param int $y - * @param int $z - * - * @return int - */ - public function getBlockLight(int $x, int $y, int $z) : int; - - /** - * @param int $x - * @param int $y - * @param int $z - * @param int $level - * - * @return bool - */ - public function setBlockLight(int $x, int $y, int $z, int $level) : bool; - - /** - * @param int $x - * @param int $y - * @param int $z - * - * @return int - */ - public function getBlockSkyLight(int $x, int $y, int $z) : int; - - /** - * @param int $x - * @param int $y - * @param int $z - * @param int $level - * - * @return bool - */ - public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool; - /** * @param int $x * @param int $z