Fixed light spell not recalling its entities when cancelled

This commit is contained in:
Sollace 2022-01-01 00:02:20 +02:00
parent 1a3eb9f0f6
commit 7d0b7ae9f6

View file

@ -73,6 +73,16 @@ public class LightSpell extends AbstractSpell {
return true; return true;
} }
@Override
public void onDestroyed(Caster<?> caster) {
lights.forEach(ref -> {
ref.ifPresent(caster.getWorld(), e -> {
e.world.sendEntityStatus(e, (byte)60);
e.discard();
});
});
}
@Override @Override
public void toNBT(NbtCompound compound) { public void toNBT(NbtCompound compound) {
super.toNBT(compound); super.toNBT(compound);