diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 2d9ad3fb..a3147292 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -190,6 +190,13 @@ public final class Settings { /** * Blocks that Baritone is not allowed to break */ + public final Setting> blocksToDisallowBreaking = new Setting<>(new ArrayList<>( + // Leave Empty by Default + )); + + /** + * blocks that baritone shouldn't break, but can if it needs to. + */ public final Setting> blocksToAvoidBreaking = new Setting<>(new ArrayList<>(Arrays.asList( // TODO can this be a HashSet or ImmutableSet? Blocks.CRAFTING_TABLE, Blocks.FURNACE, @@ -200,6 +207,11 @@ public final class Settings { Blocks.WALL_SIGN ))); + /** + * this multiplies the break speed, if set above 1 it's "encourage breaking" instead + */ + public final Setting avoidBreakingMultiplier = new Setting<>(.1); + /** * A list of blocks to be treated as if they're air. *

diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 69e846a2..f5f565e3 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -50,7 +50,8 @@ public interface MovementHelper extends ActionCosts, Helper { static boolean avoidBreaking(BlockStateInterface bsi, int x, int y, int z, IBlockState state) { Block b = state.getBlock(); - return b == Blocks.ICE // ice becomes water, and water can mess up the path + return Baritone.settings().blocksToDisallowBreaking.value.contains(b) + || b == Blocks.ICE // ice becomes water, and water can mess up the path || b instanceof BlockSilverfish // obvious reasons // call context.get directly with x,y,z. no need to make 5 new BlockPos for no reason || avoidAdjacentBreaking(bsi, x, y + 1, z, true) diff --git a/src/main/java/baritone/utils/ToolSet.java b/src/main/java/baritone/utils/ToolSet.java index e5e96e34..4d17b4ea 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -165,7 +165,7 @@ public class ToolSet { } private double avoidanceMultiplier(Block b) { - return Baritone.settings().blocksToAvoidBreaking.value.contains(b) ? 0.1 : 1; + return Baritone.settings().blocksToAvoidBreaking.value.contains(b) ? Baritone.settings().avoidBreakingMultiplier.value : 1; } /**