From 83265fcb542beb0550031c1e77e86db33252be74 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 22 Apr 2019 19:52:04 -0700 Subject: [PATCH] add blocks to avoid breaking, fixes #368 --- src/api/java/baritone/api/Settings.java | 7 +++++++ .../java/baritone/pathing/movement/MovementHelper.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 5d672047..9306e9b0 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -157,6 +157,13 @@ public final class Settings { // Leave Empty by Default )); + /** + * Blocks that Baritone is not allowed to break + */ + public final Setting> blocksToAvoidBreaking = new Setting<>(new ArrayList<>( + // e.g. crafting table, beds + )); + /** * Enables some more advanced vine features. They're honestly just gimmicks and won't ever be needed in real * pathing scenarios. And they can cause Baritone to get trapped indefinitely in a strange scenario. diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 322b9ac6..c0683d47 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -55,7 +55,8 @@ public interface MovementHelper extends ActionCosts, Helper { || bsi.get0(x + 1, y, z).getBlock() instanceof BlockLiquid || bsi.get0(x - 1, y, z).getBlock() instanceof BlockLiquid || bsi.get0(x, y, z + 1).getBlock() instanceof BlockLiquid - || bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid; + || bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid + || Baritone.settings().blocksToAvoidBreaking.value.contains(b); } static boolean canWalkThrough(IPlayerContext ctx, BetterBlockPos pos) {