From 2eba22031a524215993da1f57a5bf7c5385e0a13 Mon Sep 17 00:00:00 2001 From: RealIndrit Date: Fri, 14 Aug 2020 22:47:39 +0200 Subject: [PATCH] Maybe dont have ignore cost calculation override auto tool? --- src/api/java/baritone/api/Settings.java | 6 ++++-- src/main/java/baritone/utils/ToolSet.java | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 0776d2b3..15c9ba35 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -67,9 +67,11 @@ public final class Settings { public final Setting autoTool = new Setting<>(true); /** - * Should movement cost calculation ignore the cost of breaking blocks with current slot? + * 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 - * migth mess up pathing in some combinations with auto tool setting. (just fall back to original settings if any + * might mess up pathing in some combinations with auto tool setting. (just fall back to original settings if any * problems occurs) */ public final Setting ignoreAutoToolMovementCost = new Setting<>(false); diff --git a/src/main/java/baritone/utils/ToolSet.java b/src/main/java/baritone/utils/ToolSet.java index 0f791cb7..b903bdf3 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -96,7 +96,8 @@ public class ToolSet { } /** - * Calculate which tool on the hotbar is best for mining + * Calculate which tool on the hotbar is best for mining, depending on an override setting, + * related to auto tool movement cost, it will either return current selected slot, or the best slot. * * @param b the blockstate to be mined * @return An int containing the index in the tools array that worked best @@ -107,7 +108,11 @@ public class ToolSet { } public int getBestSlot(Block b, boolean preferSilkTouch, boolean pathingCalculation) { - // Make all depending calculation respect auto tool value without doing unecessary calculations... + + /* + 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) + */ if (!Baritone.settings().ignoreAutoToolMovementCost.value && pathingCalculation) { return player.inventory.currentItem; }