diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 5b0d58edc..0776d2b3f 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 2d8a1a2ae..0f791cb73 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); }