From 36015079316b0d85810320d3d63e82eb85952a71 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 29 Apr 2023 23:53:02 +0100 Subject: [PATCH] Remove the metamorphosis potion when complete --- .../unicopia/entity/effect/RaceChangeStatusEffect.java | 8 +++++++- 1 file changed, 7 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 ee028ea2..5118f561 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java @@ -84,6 +84,7 @@ public class RaceChangeStatusEffect extends StatusEffect { if (progression == 0 && entity instanceof PlayerEntity player && stage == Stage.CRAWLING) { player.sendMessage(Stage.INITIAL.getMessage(race), true); } + entity.removeStatusEffect(this); return; } @@ -106,6 +107,8 @@ public class RaceChangeStatusEffect extends StatusEffect { } if (stage == Stage.DEATH) { + entity.removeStatusEffect(this); + if (eq instanceof Caster) { ((Caster)eq).getSpellSlot().clear(); } @@ -115,7 +118,10 @@ public class RaceChangeStatusEffect extends StatusEffect { magic.getEnergy().set(0.6F); magic.getExhaustion().set(0); magic.getExertion().set(0); - entity.damage(MagicalDamageSource.TRIBE_SWAP, Float.MAX_VALUE); + + if (!pony.asEntity().isCreative()) { + entity.damage(MagicalDamageSource.TRIBE_SWAP, Float.MAX_VALUE); + } } else { eq.setSpecies(race); }