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 3aebdee8c2
commit d1b5a73b18
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -112,7 +112,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);