From ac55de63e9a8665770d0e80316793d28f2bf914a Mon Sep 17 00:00:00 2001 From: RealIndrit Date: Fri, 14 Aug 2020 17:55:10 +0200 Subject: [PATCH] Maybe dont have ignore cost calculation override auto tool? --- src/api/java/baritone/api/Settings.java | 2 +- src/main/java/baritone/utils/ToolSet.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 5b0d58ed..0776d2b3 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -69,7 +69,7 @@ public final class Settings { /** * Should movement cost calculation ignore the cost of breaking blocks with current slot? * Only use this if actually necessary, make sure to put this back to original state (false), or it - * will mess up pathing in some combinations with auto tool setting. (just fall back to original settings if any + * migth 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 2d8a1a2a..0f791cb7 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -101,9 +101,14 @@ public class ToolSet { * @param b the blockstate to be mined * @return An int containing the index in the tools array that worked best */ + public int getBestSlot(Block b, boolean preferSilkTouch) { + return getBestSlot(b, preferSilkTouch, false); + } + + public int getBestSlot(Block b, boolean preferSilkTouch, boolean pathingCalculation) { // Make all depending calculation respect auto tool value without doing unecessary calculations... - if (!Baritone.settings().ignoreAutoToolMovementCost.value) { + if (!Baritone.settings().ignoreAutoToolMovementCost.value && pathingCalculation) { return player.inventory.currentItem; } @@ -142,7 +147,7 @@ public class ToolSet { * @return A double containing the destruction ticks with the best tool */ private double getBestDestructionTime(Block b) { - ItemStack stack = player.inventory.getStackInSlot(getBestSlot(b, false)); + ItemStack stack = player.inventory.getStackInSlot(getBestSlot(b, false, true)); return calculateSpeedVsBlock(stack, b.getDefaultState()) * avoidanceMultiplier(b); }