mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +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;
|
$maxY = $minY + 16;
|
||||||
$maxZ = $minZ + 16;
|
$maxZ = $minZ + 16;
|
||||||
|
|
||||||
|
$worldMinY = $world->getMinY();
|
||||||
|
|
||||||
for($attempts = 0; $attempts < 16; ++$attempts){
|
for($attempts = 0; $attempts < 16; ++$attempts){
|
||||||
$x = mt_rand($minX, $maxX);
|
$x = mt_rand($minX, $maxX);
|
||||||
$y = mt_rand($minY, $maxY);
|
$y = mt_rand($minY, $maxY);
|
||||||
$z = mt_rand($minZ, $maxZ);
|
$z = mt_rand($minZ, $maxZ);
|
||||||
|
|
||||||
while($y >= 0 && !$world->getBlockAt($x, $y, $z)->isSolid()){
|
while($y >= $worldMinY && !$world->getBlockAt($x, $y, $z)->isSolid()){
|
||||||
$y--;
|
$y--;
|
||||||
}
|
}
|
||||||
if($y < 0){
|
if($y < $worldMinY){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user