mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Fixed chorus fruit teleporting players into the void in superflat worlds
This commit is contained in:
parent
f10c2a2df2
commit
1edf69892a
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user