Added World::Y_MIN

preparation for Y axis expansion in 1.17
This commit is contained in:
Dylan K. Taylor
2021-03-17 23:19:49 +00:00
parent 5a59afbe2c
commit b844c4266d
4 changed files with 9 additions and 8 deletions

View File

@ -65,7 +65,7 @@ class DragonEgg extends Transparent implements Fallable{
for($tries = 0; $tries < 16; ++$tries){
$block = $this->pos->getWorld()->getBlockAt(
$this->pos->x + mt_rand(-16, 16),
max(0, min(World::Y_MAX - 1, $this->pos->y + mt_rand(-8, 8))),
max(World::Y_MIN, min(World::Y_MAX - 1, $this->pos->y + mt_rand(-8, 8))),
$this->pos->z + mt_rand(-16, 16)
);
if($block instanceof Air){