Fixed placed spells not playing their death animations and/or getting stuck and impossible to remove

This commit is contained in:
Sollace 2024-05-22 21:21:08 +01:00
parent 2910b8d29c
commit 575c1f7438
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -48,24 +48,26 @@ public abstract class AbstractDelegatingSpell implements Spell {
@Override @Override
public void setDead() { public void setDead() {
Spell spell = delegate.get(); if (delegate.get() instanceof Spell p) {
if (spell != null) { p.setDead();
spell.setDead();
} }
} }
@Override @Override
public void tickDying(Caster<?> caster) { public void tickDying(Caster<?> caster) {
if (delegate.get() instanceof Spell p) {
p.tickDying(caster);
}
} }
@Override @Override
public boolean isDead() { public boolean isDead() {
return delegate.get() == null || delegate.get().isDead(); return !(delegate.get() instanceof Spell p) || p.isDead();
} }
@Override @Override
public boolean isDying() { public boolean isDying() {
return false; return delegate.get() instanceof Spell p && p.isDying();
} }
@Override @Override