Try to prevent bats from respawning in lava or water

This commit is contained in:
Sollace 2022-10-15 14:05:29 +02:00
parent 493d746884
commit 2ec2860fdd

View file

@ -48,6 +48,11 @@ public class SpawnLocator extends SpawnLocating {
while (world.isAir(mutable) && mutable.getY() >= spawnPos.getY() - spawnRadius * 2 && !world.isOutOfHeightLimit(mutable)) {
mutable.move(0, -1, 0);
}
if (!world.getFluidState(mutable).isEmpty()) {
continue;
}
if (!world.isAir(mutable)) {
mutable.move(0, 1, 0);
}