mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Fixed placed spells not playing their death animations and/or getting stuck and impossible to remove
This commit is contained in:
parent
2910b8d29c
commit
575c1f7438
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue