Remove the metamorphosis potion when complete

This commit is contained in:
Sollace 2023-04-29 23:53:02 +01:00
parent 5be2b2a0b9
commit 3601507931

View file

@ -84,6 +84,7 @@ public class RaceChangeStatusEffect extends StatusEffect {
if (progression == 0 && entity instanceof PlayerEntity player && stage == Stage.CRAWLING) { if (progression == 0 && entity instanceof PlayerEntity player && stage == Stage.CRAWLING) {
player.sendMessage(Stage.INITIAL.getMessage(race), true); player.sendMessage(Stage.INITIAL.getMessage(race), true);
} }
entity.removeStatusEffect(this);
return; return;
} }
@ -106,6 +107,8 @@ public class RaceChangeStatusEffect extends StatusEffect {
} }
if (stage == Stage.DEATH) { if (stage == Stage.DEATH) {
entity.removeStatusEffect(this);
if (eq instanceof Caster) { if (eq instanceof Caster) {
((Caster<?>)eq).getSpellSlot().clear(); ((Caster<?>)eq).getSpellSlot().clear();
} }
@ -115,7 +118,10 @@ public class RaceChangeStatusEffect extends StatusEffect {
magic.getEnergy().set(0.6F); magic.getEnergy().set(0.6F);
magic.getExhaustion().set(0); magic.getExhaustion().set(0);
magic.getExertion().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 { } else {
eq.setSpecies(race); eq.setSpecies(race);
} }