legitMineYLevel = new Setting<>(11);
+ /**
+ * Magically see ores that are separated diagonally from existing ores. Basically like mining around the ores that it finds
+ * in case there's one there touching it diagonally, except it checks it un-legit-ly without having the mine blocks to see it.
+ * You can decide whether this looks plausible or not.
+ *
+ * This is disabled because it results in some weird behavior. For example, it can """see""" the top block of a vein of iron_ore
+ * through a lava lake. This isn't an issue normally since it won't consider anything touching lava, so it just ignores it.
+ * However, this setting expands that and allows it to see the entire vein so it'll mine under the lava lake to get the iron that
+ * it can reach without mining blocks adjacent to lava. This really defeats the purpose of legitMine since a player could never
+ * do that lol, so thats one reason why its disabled
+ */
+ public final Setting legitMineIncludeDiagonals = new Setting<>(false);
+
/**
* When mining block of a certain type, try to mine two at once instead of one.
* If the block above is also a goal block, set GoalBlock instead of GoalTwoBlocks
diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java
index 513caed0..a299bf31 100644
--- a/src/main/java/baritone/process/MineProcess.java
+++ b/src/main/java/baritone/process/MineProcess.java
@@ -228,7 +228,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
return prune(ctx, locs, mining, max);
}
- public void addNearby() {
+ private void addNearby() {
knownOreLocations.addAll(droppedItemsScan(mining, ctx.world()));
BlockPos playerFeet = ctx.playerFeet();
BlockStateInterface bsi = new BlockStateInterface(ctx);
@@ -239,8 +239,11 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
for (int z = playerFeet.getZ() - searchDist; z <= playerFeet.getZ() + searchDist; z++) {
// crucial to only add blocks we can see because otherwise this
// is an x-ray and it'll get caught
- if (mining.contains(bsi.get0(x, y, z).getBlock()) && RotationUtils.reachable(ctx.player(), new BlockPos(x, y, z), fakedBlockReachDistance).isPresent()) {
- knownOreLocations.add(new BlockPos(x, y, z));
+ if (mining.contains(bsi.get0(x, y, z).getBlock())) {
+ BlockPos pos = new BlockPos(x, y, z);
+ if ((Baritone.settings().legitMineIncludeDiagonals.get() && knownOreLocations.stream().anyMatch(ore -> ore.distanceSq(pos) <= 2 /* sq means this is pytha dist <= sqrt(2) */)) || RotationUtils.reachable(ctx.player(), pos, fakedBlockReachDistance).isPresent()) {
+ knownOreLocations.add(pos);
+ }
}
}
}
@@ -263,7 +266,6 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
.distinct()
// remove any that are within loaded chunks that aren't actually what we want
-
.filter(pos -> !ctx.bsi.worldContainsLoadedChunk(pos.getX(), pos.getZ()) || mining.contains(ctx.getBlock(pos.getX(), pos.getY(), pos.getZ())) || dropped.contains(pos))
// remove any that are implausible to mine (encased in bedrock, or touching lava)