diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 2b7e19395..3a12a7a4d 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -960,8 +960,8 @@ class Level implements ChunkManager, Metadatable{ $index = Level::blockHash($pos->x, $pos->y, $pos->z); if($cached === true and isset($this->blockCache[$index])){ return $this->blockCache[$index]; - }elseif($pos->y >= 0 and $pos->y < 128 and ($chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4)) !== null){ - $fullState = $chunk->getFullBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f); + }elseif($pos->y >= 0 and $pos->y < 128 and isset($this->chunks[$chunkIndex = Level::chunkHash($pos->x >> 4, $pos->z >> 4)])){ + $fullState = $this->chunks[$chunkIndex]->getFullBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f); }else{ $fullState = 0; }