Merge remote-tracking branch 'origin/stable' into minor-next

This commit is contained in:
Dylan K. Taylor
2023-08-15 17:41:41 +01:00
5 changed files with 37 additions and 22 deletions

View File

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