mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Fix chorus not working if the destination would be below y=0 (#5979)
This commit is contained in:
parent
b86b389fc5
commit
f03e708f64
@ -56,15 +56,17 @@ class ChorusFruit extends Food{
|
||||
$maxY = $minY + 16;
|
||||
$maxZ = $minZ + 16;
|
||||
|
||||
$worldMinY = $world->getMinY();
|
||||
|
||||
for($attempts = 0; $attempts < 16; ++$attempts){
|
||||
$x = mt_rand($minX, $maxX);
|
||||
$y = mt_rand($minY, $maxY);
|
||||
$z = mt_rand($minZ, $maxZ);
|
||||
|
||||
while($y >= 0 && !$world->getBlockAt($x, $y, $z)->isSolid()){
|
||||
while($y >= $worldMinY && !$world->getBlockAt($x, $y, $z)->isSolid()){
|
||||
$y--;
|
||||
}
|
||||
if($y < 0){
|
||||
if($y < $worldMinY){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user