diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 43bb7d112..38ea07f37 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2177,6 +2177,9 @@ class Level implements ChunkManager, Metadatable{ * @param int $id 0-255 */ public function setBlockIdAt(int $x, int $y, int $z, int $id){ + if(!$this->isInWorld($x, $y, $z)){ //TODO: bad hack but fixing this requires BC breaks to do properly :( + return; + } unset($this->blockCache[$chunkHash = Level::chunkHash($x >> 4, $z >> 4)][$blockHash = Level::blockHash($x, $y, $z)]); $this->getChunk($x >> 4, $z >> 4, true)->setBlockId($x & 0x0f, $y, $z & 0x0f, $id & 0xff); @@ -2211,6 +2214,9 @@ class Level implements ChunkManager, Metadatable{ * @param int $data 0-15 */ public function setBlockDataAt(int $x, int $y, int $z, int $data){ + if(!$this->isInWorld($x, $y, $z)){ //TODO: bad hack but fixing this requires BC breaks to do properly :( + return; + } unset($this->blockCache[$chunkHash = Level::chunkHash($x >> 4, $z >> 4)][$blockHash = Level::blockHash($x, $y, $z)]); $this->getChunk($x >> 4, $z >> 4, true)->setBlockData($x & 0x0f, $y, $z & 0x0f, $data & 0x0f);