From 66e46e1c0751a59ed134d1a1acf044209d5d98aa Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 26 Aug 2018 18:57:08 +0100 Subject: [PATCH] Level: use chunk records for tile reading in getTileAt() the previous revision caused a crash when clicking on the bottom of the world due to a block hash being out of bounds. --- src/pocketmine/level/Level.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 9e9514fa9..533febadf 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2039,7 +2039,7 @@ class Level implements ChunkManager, Metadatable{ * @return Tile|null */ public function getTileAt(int $x, int $y, int $z) : ?Tile{ - return $this->tiles[Level::blockHash($x, $y, $z)] ?? null; + return ($chunk = $this->getChunk($x >> 4, $z >> 4)) !== null ? $chunk->getTile($x & 0x0f, $y, $z & 0x0f) : null; } /**