diff --git a/src/main/java/baritone/behavior/impl/MineBehavior.java b/src/main/java/baritone/behavior/impl/MineBehavior.java index e59058a8..32f92877 100644 --- a/src/main/java/baritone/behavior/impl/MineBehavior.java +++ b/src/main/java/baritone/behavior/impl/MineBehavior.java @@ -55,11 +55,6 @@ public class MineBehavior extends Behavior { return; } List locs = new ArrayList<>(WorldProvider.INSTANCE.getCurrentWorld().cache.getLocationsOf(mining, 1, 1)); - if (locs.isEmpty()) { - displayChatMessageRaw("No locations for " + mining + " known, cancelling"); - cancel(); - return; - } BlockPos playerFeet = playerFeet(); locs.sort(Comparator.comparingDouble(playerFeet::distanceSq)); @@ -71,6 +66,11 @@ public class MineBehavior extends Behavior { if (locs.size() > 30) { locs = locs.subList(0, 30); } + if (locs.isEmpty()) { + displayChatMessageRaw("No locations for " + mining + " known, cancelling"); + cancel(); + return; + } PathingBehavior.INSTANCE.setGoal(new GoalComposite(locs.stream().map(GoalTwoBlocks::new).toArray(Goal[]::new))); PathingBehavior.INSTANCE.path(); }