diff --git a/src/main/java/baritone/bot/pathing/goals/GoalComposite.java b/src/main/java/baritone/bot/pathing/goals/GoalComposite.java index cff145dd..de74310b 100644 --- a/src/main/java/baritone/bot/pathing/goals/GoalComposite.java +++ b/src/main/java/baritone/bot/pathing/goals/GoalComposite.java @@ -26,18 +26,9 @@ public class GoalComposite implements Goal { this(blocks.stream().map(GoalBlock::new).toArray(Goal[]::new)); } - public Goal[] goals() { - return goals; - } - @Override public boolean isInGoal(BlockPos pos) { - for (Goal g : goals) { - if (g.isInGoal(pos)) { - return true; - } - } - return false; + return Arrays.stream(this.goals).anyMatch(goal -> goal.isInGoal(pos)); } @Override @@ -53,4 +44,8 @@ public class GoalComposite implements Goal { public String toString() { return "GoalComposite" + Arrays.toString(goals); } + + public Goal[] goals() { + return goals; + } }