Maybe dont have ignore cost calculation override auto tool?

This commit is contained in:
RealIndrit 2020-08-14 17:55:10 +02:00
parent 88e2fba447
commit ac55de63e9
2 changed files with 8 additions and 3 deletions

View File

@ -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<Boolean> ignoreAutoToolMovementCost = new Setting<>(false);

View File

@ -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);
}