Don't trap the thrower

This commit is contained in:
Sollace 2020-05-06 15:56:33 +02:00
parent 3789c31062
commit 871edea0d7

View file

@ -186,6 +186,8 @@ public class ChangelingTrapSpell extends AbstractSpell implements TossedMagicEff
} else { } else {
existing.enforce(e); existing.enforce(e);
} }
e.spawnParticles(ParticleTypes.DRIPPING_LAVA, 20);
} }
protected boolean canAffect(Entity e) { protected boolean canAffect(Entity e) {
@ -199,6 +201,7 @@ public class ChangelingTrapSpell extends AbstractSpell implements TossedMagicEff
if (caster.isLocal()) { if (caster.isLocal()) {
caster.findAllEntitiesInRange(5) caster.findAllEntitiesInRange(5)
.filter(this::canAffect) .filter(this::canAffect)
.filter(e -> e != caster.getOwner())
.map(e -> CasterUtils.toCaster(e)) .map(e -> CasterUtils.toCaster(e))
.filter(Optional::isPresent) .filter(Optional::isPresent)
.map(Optional::get) .map(Optional::get)