use of com.skelril.openboss.condition.DamagedCondition in project Skree by Skelril.
the class DamageNearby method apply.
@Override
public Optional<Instruction<DamagedCondition, T>> apply(DamagedCondition damagedCondition, T bossDetail) {
Living boss = bossDetail.getTargetEntity().get();
CuboidContainmentPredicate predicate = new CuboidContainmentPredicate(boss.getLocation().getPosition(), 2, 2, 2);
boss.getNearbyEntities(e -> predicate.test(e.getLocation().getPosition())).stream().filter(e -> e instanceof Living).map(e -> (Living) e).filter(e -> checkTarget(bossDetail, e)).forEach(e -> damage(bossDetail, e));
return Optional.empty();
}
Aggregations