mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Revert seaponies back to normal if we're not able to respawn them underwater
This commit is contained in:
parent
11f0bbc4e4
commit
5109b67de2
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
boolean mustAvoidAir = getCompositeRace().includes(Race.SEAPONY) && !sw.getFluidState(getOrigin()).isIn(FluidTags.WATER);
|
||||||
if (mustAvoidSun || mustAvoidAir) {
|
if (mustAvoidSun || mustAvoidAir) {
|
||||||
SpawnLocator.selectSpawnPosition(sw, entity, mustAvoidAir, mustAvoidSun);
|
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;
|
ticksSunImmunity = INITIAL_SUN_IMMUNITY;
|
||||||
|
|
Loading…
Reference in a new issue