From 2ddc2c3660d591d42e39a935bb46c27e924ee22a Mon Sep 17 00:00:00 2001 From: RealIndrit Date: Thu, 13 Aug 2020 22:36:34 +0200 Subject: [PATCH] Add auto tool settings because 2 lines of code lols --- src/api/java/baritone/api/Settings.java | 5 +++++ src/main/java/baritone/utils/ToolSet.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 3da1d21b..c03b0b72 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -61,6 +61,11 @@ public final class Settings { */ public final Setting allowInventory = new Setting<>(false); + /** + * Allow player to decide if to use auto tool or not + */ + public final Setting autoTool = new Setting<>(true); + /** * It doesn't actually take twenty ticks to place a block, this cost is so high * because we want to generally conserve blocks which might be limited. diff --git a/src/main/java/baritone/utils/ToolSet.java b/src/main/java/baritone/utils/ToolSet.java index b6446b30..01784302 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -127,7 +127,7 @@ public class ToolSet { } } } - return best; + return Baritone.settings().autoTool.value? best : player.inventory.currentItem; } /**