Revert seaponies back to normal if we're not able to respawn them underwater

This commit is contained in:
Sollace 2024-03-28 16:23:42 +00:00
parent 11f0bbc4e4
commit 5109b67de2
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -388,6 +388,13 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
boolean mustAvoidAir = getCompositeRace().includes(Race.SEAPONY) && !sw.getFluidState(getOrigin()).isIn(FluidTags.WATER);
if (mustAvoidSun || mustAvoidAir) {
SpawnLocator.selectSpawnPosition(sw, entity, mustAvoidAir, mustAvoidSun);
if ((mustAvoidAir && !sw.getFluidState(getOrigin()).isIn(FluidTags.WATER))
|| (mustAvoidSun && MeteorlogicalUtil.isPositionExposedToSun(sw, getOrigin()))) {
Race suppressedRace = getSuppressedRace();
if (suppressedRace != Race.UNSET) {
setSpecies(suppressedRace);
}
}
}
}
ticksSunImmunity = INITIAL_SUN_IMMUNITY;