From bfb530e02b7ad72fb660f3b2df02b52e883fbdb4 Mon Sep 17 00:00:00 2001 From: Sam Corbett Date: Fri, 16 Oct 2020 17:02:02 +0100 Subject: [PATCH] add a minimum Y level. Signed-off-by: Sam Corbett --- src/api/java/baritone/api/Settings.java | 5 +++++ src/main/java/baritone/process/MineProcess.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 86cb75c1..96e4c579 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -738,6 +738,11 @@ public final class Settings { */ public final Setting maxCachedWorldScanCount = new Setting<>(10); + /** + * Sets the minimum y level whilst mining - set to 0 to turn off. + */ + public final Setting minYLevelWhileMining = new Setting<>(0); + /** * This will only allow baritone to mine exposed ores, can be used to stop ore obfuscators on servers that use them. */ diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index b8474e2f..5bce121d 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -417,6 +417,8 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro } }) + .filter(pos -> pos.getY() > Baritone.settings().minYLevelWhileMining.value) + .filter(pos -> !blacklist.contains(pos)) .sorted(Comparator.comparingDouble(ctx.getBaritone().getPlayerContext().player()::getDistanceSq))