From 253fbad3dbe689bd0ba75f680e8e77f4982d1692 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Mon, 10 May 2021 22:37:35 +0200 Subject: [PATCH 1/2] Make MineProcess respect exploreForBlocks --- src/api/java/baritone/api/Settings.java | 2 +- src/main/java/baritone/process/MineProcess.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 24d644b6..453d369c 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -784,7 +784,7 @@ public final class Settings { public final Setting 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 exploreForBlocks = new Setting<>(true); diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 8b0b5bac..ec5f35ad 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -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); } // we don't know any ore locations at the moment - if (!legit) { + if (!Baritone.settings().exploreForBlocks.value) { 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; if (branchPoint == null) { /*if (!baritone.getPathingBehavior().isPathing() && playerFeet().y == y) { @@ -230,7 +230,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro List dropped = droppedItemsScan(); List locs = searchWorld(context, filter, ORE_LOCATIONS_COUNT, already, blacklist, dropped); locs.addAll(dropped); - if (locs.isEmpty()) { + if (locs.isEmpty() && !Baritone.settings().exploreForBlocks.value) { logDirect("No locations for " + filter + " known, cancelling"); if (Baritone.settings().desktopNotifications.value && Baritone.settings().notificationOnMineFail.value) { NotificationHelper.notify("No locations for " + filter + " known, cancelling", true); From f99bf0d000364b2301c2b1b5903605258f288eb9 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Fri, 28 May 2021 22:18:33 +0200 Subject: [PATCH 2/2] Make legitMode always explore --- src/api/java/baritone/api/Settings.java | 3 ++- src/main/java/baritone/process/MineProcess.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 453d369c..edbb3de7 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -784,7 +784,7 @@ public final class Settings { public final Setting allowOnlyExposedOresDistance = new Setting<>(1); /** - * When GetToBlock or Mine doesn't know any locations for the desired block, explore randomly instead of giving up. + * When GetToBlock or non-legit Mine doesn't know any locations for the desired block, explore randomly instead of giving up. */ public final Setting exploreForBlocks = new Setting<>(true); @@ -977,6 +977,7 @@ public final class Settings { * Disallow MineBehavior from using X-Ray to see where the ores are. Turn this option on to force it to mine "legit" * where it will only mine an ore once it can actually see it, so it won't do or know anything that a normal player * couldn't. If you don't want it to look like you're X-Raying, turn this on + * This will always explore, regardless of exploreForBlocks */ public final Setting legitMine = new Setting<>(false); diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index ec5f35ad..b6a80c77 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -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); } // we don't know any ore locations at the moment - if (!Baritone.settings().exploreForBlocks.value) { + if (!legit && !Baritone.settings().exploreForBlocks.value) { return null; } - // only when we should explore for blocks we do this + // only when we should explore for blocks or are in legit mode we do this int y = Baritone.settings().legitMineYLevel.value; if (branchPoint == null) { /*if (!baritone.getPathingBehavior().isPathing() && playerFeet().y == y) {