diff --git a/src/pocketmine/item/ChorusFruit.php b/src/pocketmine/item/ChorusFruit.php index 385596b4b..9721bff29 100644 --- a/src/pocketmine/item/ChorusFruit.php +++ b/src/pocketmine/item/ChorusFruit.php @@ -63,9 +63,12 @@ class ChorusFruit extends Food{ $y = mt_rand($minY, $maxY); $z = mt_rand($minZ, $maxZ); - while($y > 0 and !$level->getBlockAt($x, $y, $z)->isSolid()){ + while($y >= 0 and !$level->getBlockAt($x, $y, $z)->isSolid()){ $y--; } + if($y < 0){ + continue; + } $blockUp = $level->getBlockAt($x, $y + 1, $z); $blockUp2 = $level->getBlockAt($x, $y + 2, $z); @@ -81,4 +84,4 @@ class ChorusFruit extends Food{ break; } } -} \ No newline at end of file +}