Merge pull request #2736 from ZacSharp/exploreForBlocksForMining

Make MineProcess respect exploreForBlocks
This commit is contained in:
Leijurv 2021-05-28 13:27:13 -07:00 committed by GitHub
commit e85c1bbc0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -793,7 +793,7 @@ public final class Settings {
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 non-legit Mine doesn't know any locations for the desired block, explore randomly instead of giving up.
*/
public final Setting<Boolean> exploreForBlocks = new Setting<>(true);
@ -986,6 +986,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<Boolean> legitMine = new Setting<>(false);

View File

@ -187,10 +187,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 (!legit && !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 or are in legit mode we do this
int y = Baritone.settings().legitMineYLevel.value;
if (branchPoint == null) {
/*if (!baritone.getPathingBehavior().isPathing() && playerFeet().y == y) {
@ -229,7 +229,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
List<BlockPos> dropped = droppedItemsScan();
List<BlockPos> 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().notificationOnMineFail.value) {
logNotification("No locations for " + filter + " known, cancelling", true);