Make MineProcess respect exploreForBlocks

This commit is contained in:
ZacSharp 2021-05-10 22:37:35 +02:00
parent fccac8ed74
commit 253fbad3db
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
2 changed files with 4 additions and 4 deletions

View File

@ -784,7 +784,7 @@ public final class Settings {
public final Setting<Integer> allowOnlyExposedOresDistance = new Setting<>(1); public final Setting<Integer> allowOnlyExposedOresDistance = new Setting<>(1);
/** /**
* When GetToBlock doesn't know any locations for the desired block, explore randomly instead of giving up. * When GetToBlock or Mine doesn't know any locations for the desired block, explore randomly instead of giving up.
*/ */
public final Setting<Boolean> exploreForBlocks = new Setting<>(true); public final Setting<Boolean> exploreForBlocks = new Setting<>(true);

View File

@ -188,10 +188,10 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
return new PathingCommand(goal, legit ? PathingCommandType.FORCE_REVALIDATE_GOAL_AND_PATH : PathingCommandType.REVALIDATE_GOAL_AND_PATH); return new PathingCommand(goal, legit ? PathingCommandType.FORCE_REVALIDATE_GOAL_AND_PATH : PathingCommandType.REVALIDATE_GOAL_AND_PATH);
} }
// we don't know any ore locations at the moment // we don't know any ore locations at the moment
if (!legit) { if (!Baritone.settings().exploreForBlocks.value) {
return null; return null;
} }
// only in non-Xray mode (aka legit mode) do we do this // only when we should explore for blocks we do this
int y = Baritone.settings().legitMineYLevel.value; int y = Baritone.settings().legitMineYLevel.value;
if (branchPoint == null) { if (branchPoint == null) {
/*if (!baritone.getPathingBehavior().isPathing() && playerFeet().y == y) { /*if (!baritone.getPathingBehavior().isPathing() && playerFeet().y == y) {
@ -230,7 +230,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
List<BlockPos> dropped = droppedItemsScan(); List<BlockPos> dropped = droppedItemsScan();
List<BlockPos> locs = searchWorld(context, filter, ORE_LOCATIONS_COUNT, already, blacklist, dropped); List<BlockPos> locs = searchWorld(context, filter, ORE_LOCATIONS_COUNT, already, blacklist, dropped);
locs.addAll(dropped); locs.addAll(dropped);
if (locs.isEmpty()) { if (locs.isEmpty() && !Baritone.settings().exploreForBlocks.value) {
logDirect("No locations for " + filter + " known, cancelling"); logDirect("No locations for " + filter + " known, cancelling");
if (Baritone.settings().desktopNotifications.value && Baritone.settings().notificationOnMineFail.value) { if (Baritone.settings().desktopNotifications.value && Baritone.settings().notificationOnMineFail.value) {
NotificationHelper.notify("No locations for " + filter + " known, cancelling", true); NotificationHelper.notify("No locations for " + filter + " known, cancelling", true);