From 98516235574282d213f62107e261cc8a55f2e7f2 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 17 Aug 2020 16:03:04 -0700 Subject: [PATCH] anti-indrit-cringe --- src/api/java/baritone/api/Settings.java | 16 +++++++--------- .../pathing/movement/MovementHelper.java | 2 +- src/main/java/baritone/utils/ToolSet.java | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index b48bf55f..5dfcef6a 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -62,19 +62,17 @@ public final class Settings { public final Setting allowInventory = new Setting<>(false); /** - * Allow player to decide if to use auto tool or not + * Disable baritone's auto-tool at runtime, but still assume that another mod will provide auto tool functionality + *

+ * Specifically, path calculation will still assume that an auto tool wil run at execution time, even though + * Baritone itself will not do that. */ - public final Setting autoTool = new Setting<>(true); + public final Setting assumeExternalAutoTool = new Setting<>(false); /** - * Should movement cost calculation ignore the cost of breaking blocks with current slot, and assume best possible - * item in the hotbar? - * - * Only use this if actually necessary, make sure to put this back to original state (false), or it - * might mess up pathing in some combinations with auto tool setting. (just fall back to original settings if any - * problems occurs) + * If this setting is on, no auto tool will occur at all, not at calculation time nor execution time */ - public final Setting ignoreAutoToolMovementCost = new Setting<>(false); + public final Setting disableAutoTool = new Setting<>(false); /** * It doesn't actually take twenty ticks to place a block, this cost is so high diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 7ae57ae4..7165303c 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -432,7 +432,7 @@ public interface MovementHelper extends ActionCosts, Helper { * @param ts previously calculated ToolSet */ static void switchToBestToolFor(IPlayerContext ctx, IBlockState b, ToolSet ts, boolean preferSilkTouch) { - if (Baritone.settings().autoTool.value) { + if (!Baritone.settings().disableAutoTool.value && !Baritone.settings().assumeExternalAutoTool.value) { ctx.player().inventory.currentItem = ts.getBestSlot(b.getBlock(), preferSilkTouch); } } diff --git a/src/main/java/baritone/utils/ToolSet.java b/src/main/java/baritone/utils/ToolSet.java index b903bdf3..aa8819ce 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -111,9 +111,9 @@ public class ToolSet { /* If we actually want know what efficiency our held item has instead of the best one - possible, this lets us make pathing depending on the actual tool used (if auto tool is disabled) + possible, this lets us make pathing depend on the actual tool to be used (if auto tool is disabled) */ - if (!Baritone.settings().ignoreAutoToolMovementCost.value && pathingCalculation) { + if (Baritone.settings().disableAutoTool.value && pathingCalculation) { return player.inventory.currentItem; }