From 85e1b77caeb352b5088269be6938c4772976965f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 5 Mar 2019 04:14:28 -0500 Subject: [PATCH] fix crash in getHighestBlockAt() --- src/pocketmine/level/format/SubChunk.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pocketmine/level/format/SubChunk.php b/src/pocketmine/level/format/SubChunk.php index 857277fe8..4a4aa4f43 100644 --- a/src/pocketmine/level/format/SubChunk.php +++ b/src/pocketmine/level/format/SubChunk.php @@ -138,6 +138,9 @@ class SubChunk implements SubChunkInterface{ } public function getHighestBlockAt(int $x, int $z) : int{ + if(empty($this->blockLayers)){ + return -1; + } for($y = 15; $y >= 0; --$y){ if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){ return $y;