mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Fixed the assistant spell not properly preserving the state of its held spell
This commit is contained in:
parent
1700ce9276
commit
45d5840f82
1 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,11 @@ public class SpellDrake extends AbstractSpell {
|
||||||
return super.getDead();
|
return super.getDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDirty() {
|
||||||
|
return super.isDirty() || (piggyBackSpell != null && piggyBackSpell.isDirty());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlaced(ICaster<?> caster) {
|
public void onPlaced(ICaster<?> caster) {
|
||||||
if (caster.getEntity() instanceof EntitySpell) {
|
if (caster.getEntity() instanceof EntitySpell) {
|
||||||
|
@ -108,7 +113,11 @@ public class SpellDrake extends AbstractSpell {
|
||||||
super.readFromNBT(compound);
|
super.readFromNBT(compound);
|
||||||
|
|
||||||
if (compound.hasKey("effect")) {
|
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"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue