From 867c01ff86588be6105c89d38647a948af2e7f34 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 6 Apr 2019 21:50:22 -0800 Subject: [PATCH] crucial performance optimization --- src/main/java/baritone/process/MineProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index ff8d68ba..07e47b91 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -84,7 +84,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro boolean shouldCancel = calcFailed; if (calcFailed && !knownOreLocations.isEmpty() && Baritone.settings().blacklistClosestOnFailure.value) { logDirect("Unable to find any path to " + mining + ", blacklisting presumably unreachable closest instance..."); - knownOreLocations.stream().sorted(Comparator.comparingDouble(ctx.player()::getDistanceSq)).findFirst().ifPresent(blacklist::add); + knownOreLocations.stream().min(Comparator.comparingDouble(ctx.player()::getDistanceSq)).ifPresent(blacklist::add); knownOreLocations.removeIf(blacklist::contains); shouldCancel = false; // 😎 }