Fixed chorus fruit teleporting players into the void in superflat worlds

This commit is contained in:
Dylan K. Taylor 2017-12-24 16:27:58 +00:00
parent f10c2a2df2
commit 1edf69892a

View File

@ -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;
}
}
}
}