Added AutoToolMovement bypass setting for special usage cases, should not be used it not actually necessary

This commit is contained in:
RealIndrit 2020-08-14 10:58:15 +02:00
parent e0ff16e2dd
commit 19355cb4f2
3 changed files with 12 additions and 2 deletions

View File

@ -66,6 +66,14 @@ public final class Settings {
*/
public final Setting<Boolean> autoTool = new Setting<>(true);
/**
* 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
* problems occurs)
*/
public final Setting<Boolean> ignoreAutoToolMovementCost = new Setting<>(false);
/**
* 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.

View File

@ -432,7 +432,9 @@ public interface MovementHelper extends ActionCosts, Helper {
* @param ts previously calculated ToolSet
*/
static void switchToBestToolFor(IPlayerContext ctx, IBlockState b, ToolSet ts, boolean preferSilkTouch) {
ctx.player().inventory.currentItem = ts.getBestSlot(b.getBlock(), preferSilkTouch);
if (Baritone.settings().autoTool.value) {
ctx.player().inventory.currentItem = ts.getBestSlot(b.getBlock(), preferSilkTouch);
}
}
static void moveTowards(IPlayerContext ctx, MovementState state, BlockPos pos) {

View File

@ -103,7 +103,7 @@ public class ToolSet {
*/
public int getBestSlot(Block b, boolean preferSilkTouch) {
// Make all depending calculation respect auto tool value without doing unecessary calculations...
if (!Baritone.settings().autoTool.value) {
if (!Baritone.settings().ignoreAutoToolMovementCost.value) {
return player.inventory.currentItem;
}