From 45d5840f827eb2e7f869e724e956ddd0318d42ee Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 15 Feb 2019 16:09:15 +0200 Subject: [PATCH] Fixed the assistant spell not properly preserving the state of its held spell --- .../com/minelittlepony/unicopia/spell/SpellDrake.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java b/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java index 3f3b8cf1..b77a53c5 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java @@ -50,6 +50,11 @@ public class SpellDrake extends AbstractSpell { return super.getDead(); } + @Override + public boolean isDirty() { + return super.isDirty() || (piggyBackSpell != null && piggyBackSpell.isDirty()); + } + @Override public void onPlaced(ICaster caster) { if (caster.getEntity() instanceof EntitySpell) { @@ -108,7 +113,11 @@ public class SpellDrake extends AbstractSpell { super.readFromNBT(compound); if (compound.hasKey("effect")) { - piggyBackSpell = SpellRegistry.instance().createEffectFromNBT(compound.getCompoundTag("effect")); + if (piggyBackSpell != null) { + piggyBackSpell.readFromNBT(compound.getCompoundTag("effect")); + } else { + piggyBackSpell = SpellRegistry.instance().createEffectFromNBT(compound.getCompoundTag("effect")); + } } } }