crucial performance optimization
This commit is contained in:
parent
87a9e67ba8
commit
867c01ff86
@ -84,7 +84,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
|||||||
boolean shouldCancel = calcFailed;
|
boolean shouldCancel = calcFailed;
|
||||||
if (calcFailed && !knownOreLocations.isEmpty() && Baritone.settings().blacklistClosestOnFailure.value) {
|
if (calcFailed && !knownOreLocations.isEmpty() && Baritone.settings().blacklistClosestOnFailure.value) {
|
||||||
logDirect("Unable to find any path to " + mining + ", blacklisting presumably unreachable closest instance...");
|
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);
|
knownOreLocations.removeIf(blacklist::contains);
|
||||||
shouldCancel = false; // 😎
|
shouldCancel = false; // 😎
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user