Add handling to update the player's race if we're unable to force a respawn

This commit is contained in:
Sollace 2023-10-09 12:23:12 +01:00
parent 2e7804e9c6
commit f25df41fa5
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -113,7 +113,11 @@ public class RaceChangeStatusEffect extends StatusEffect {
magic.getExertion().set(0); magic.getExertion().set(0);
if (!pony.asEntity().isCreative()) { if (!pony.asEntity().isCreative()) {
entity.damage(Living.living(entity).damageOf(UDamageTypes.TRIBE_SWAP), Float.MAX_VALUE); if (!entity.damage(Living.living(entity).damageOf(UDamageTypes.TRIBE_SWAP), Float.MAX_VALUE)) {
entity.setHealth(0);
pony.setRespawnRace(Race.UNSET);
pony.setSpecies(race);
}
} }
} else { } else {
eq.setSpecies(race); eq.setSpecies(race);