mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
This commit is contained in:
parent
9d90932ce9
commit
37c62b7d0c
1 changed files with 8 additions and 12 deletions
|
@ -122,22 +122,18 @@ public class FireSpell extends AbstractAreaEffectSpell implements ProjectileDele
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean applyEntities(Caster<?> source, Vec3d pos) {
|
protected boolean applyEntities(Caster<?> source, Vec3d pos) {
|
||||||
return source.findAllEntitiesInRange(Math.max(0, 3 + getTraits().get(Trait.POWER)), i -> applyEntitySingle(source, i)).count() > 0;
|
return source.findAllEntitiesInRange(Math.max(0, 3 + getTraits().get(Trait.POWER)), e -> {
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean applyEntitySingle(Caster<?> source, Entity e) {
|
|
||||||
LivingEntity master = source.getMaster();
|
LivingEntity master = source.getMaster();
|
||||||
|
return (!(e.equals(source.asEntity()) || e.equals(master)) ||
|
||||||
if ((!(e.equals(source.asEntity()) || e.equals(master)) ||
|
|
||||||
(master instanceof PlayerEntity && !EquinePredicates.PLAYER_UNICORN.test(master))) && !(e instanceof ItemEntity)
|
(master instanceof PlayerEntity && !EquinePredicates.PLAYER_UNICORN.test(master))) && !(e instanceof ItemEntity)
|
||||||
&& !(e instanceof Caster<?>)) {
|
&& !(e instanceof Caster<?>);
|
||||||
|
}).filter(e -> {
|
||||||
e.setOnFireFor(60);
|
e.setOnFireFor(60);
|
||||||
e.damage(getDamageCause(source, e), 0.1f);
|
e.damage(getDamageCause(source, e), 0.1f);
|
||||||
playEffect(source.asWorld(), e.getBlockPos());
|
playEffect(source.asWorld(), e.getBlockPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
})
|
||||||
|
.count() > 0;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DamageSource getDamageCause(Caster<?> source, Entity target) {
|
protected DamageSource getDamageCause(Caster<?> source, Entity target) {
|
||||||
|
|
Loading…
Reference in a new issue