Make fire spells explode when hitting an entity

This commit is contained in:
Sollace 2022-09-14 11:53:56 +02:00
parent 89e8f0dccc
commit cb50ec544c

View file

@ -54,6 +54,13 @@ public class FireSpell extends AbstractAreaEffectSpell implements ProjectileSpel
}
}
@Override
public void onImpact(MagicProjectileEntity projectile, Entity entity) {
if (!projectile.isClient()) {
projectile.getReferenceWorld().createExplosion(entity, entity.getX(), entity.getY(), entity.getZ(), 2, DestructionType.DESTROY);
}
}
@Override
public boolean tick(Caster<?> source, Situation situation) {
if (source.isClient()) {
@ -182,4 +189,5 @@ public class FireSpell extends AbstractAreaEffectSpell implements ProjectileSpel
Block id = world.getBlockState(pos).getBlock();
return id == Blocks.SAND || id == Blocks.GLASS;
}
}