From f25df41fa5f6dd126909eb1eb087be714bcc9ae7 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 9 Oct 2023 12:23:12 +0100 Subject: [PATCH] Add handling to update the player's race if we're unable to force a respawn --- .../unicopia/entity/effect/RaceChangeStatusEffect.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java index b2d88521..cc937f94 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java @@ -113,7 +113,11 @@ public class RaceChangeStatusEffect extends StatusEffect { magic.getExertion().set(0); 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 { eq.setSpecies(race);