From 7d0b7ae9f6860a02062fae95dcec1fab5d46533f Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 1 Jan 2022 00:02:20 +0200 Subject: [PATCH] Fixed light spell not recalling its entities when cancelled --- .../ability/magic/spell/effect/LightSpell.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/LightSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/LightSpell.java index 27c08931..18ff18ee 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/LightSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/LightSpell.java @@ -73,6 +73,16 @@ public class LightSpell extends AbstractSpell { 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 public void toNBT(NbtCompound compound) { super.toNBT(compound);