Added AutoToolMovement bypass setting for special usage cases, should not be used it not actually necessary
This commit is contained in:
parent
e0ff16e2dd
commit
19355cb4f2
@ -66,6 +66,14 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public final Setting<Boolean> autoTool = new Setting<>(true);
|
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
|
* 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.
|
* because we want to generally conserve blocks which might be limited.
|
||||||
|
@ -432,7 +432,9 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
* @param ts previously calculated ToolSet
|
* @param ts previously calculated ToolSet
|
||||||
*/
|
*/
|
||||||
static void switchToBestToolFor(IPlayerContext ctx, IBlockState b, ToolSet ts, boolean preferSilkTouch) {
|
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) {
|
static void moveTowards(IPlayerContext ctx, MovementState state, BlockPos pos) {
|
||||||
|
@ -103,7 +103,7 @@ public class ToolSet {
|
|||||||
*/
|
*/
|
||||||
public int getBestSlot(Block b, boolean preferSilkTouch) {
|
public int getBestSlot(Block b, boolean preferSilkTouch) {
|
||||||
// Make all depending calculation respect auto tool value without doing unecessary calculations...
|
// 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;
|
return player.inventory.currentItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user