dont reassign arg

This commit is contained in:
Leijurv 2019-04-05 11:59:28 -07:00
parent bf076f6246
commit 87a9e67ba8
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -81,13 +81,14 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
return null; return null;
} }
} }
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().sorted(Comparator.comparingDouble(ctx.player()::getDistanceSq)).findFirst().ifPresent(blacklist::add);
knownOreLocations.removeIf(blacklist::contains); knownOreLocations.removeIf(blacklist::contains);
calcFailed = false; // 😎 shouldCancel = false; // 😎
} }
if (calcFailed) { if (shouldCancel) {
logDirect("Unable to find any path to " + mining + ", canceling Mine"); logDirect("Unable to find any path to " + mining + ", canceling Mine");
cancel(); cancel();
return null; return null;