more closely match the existing docs and add discourageBreaking
This commit is contained in:
parent
4dc4795cb7
commit
1ca736692d
@ -201,9 +201,16 @@ public final class Settings {
|
|||||||
)));
|
)));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* make {@link #blocksToAvoidBreaking} mean the block is never broken instead of just <i>strongly</i> discouraging it.
|
* blocks that baritone shouldn't break, but can if it needs to.
|
||||||
*/
|
*/
|
||||||
public final Setting<Boolean> avoidBreakingMeansNever = new Setting(false);
|
public final Setting<List<Block>> blocksToDiscourageBreaking = new Setting<>(new ArrayList<>(Arrays.asList(
|
||||||
|
|
||||||
|
)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this multiplies the break speed, if set above 1 it's "encourage breaking" instead
|
||||||
|
*/
|
||||||
|
public final Setting<Double> discourageBreakingMultiplier = new Setting<>(.1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of blocks to be treated as if they're air.
|
* A list of blocks to be treated as if they're air.
|
||||||
|
@ -50,7 +50,8 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
|
|
||||||
static boolean avoidBreaking(BlockStateInterface bsi, int x, int y, int z, IBlockState state) {
|
static boolean avoidBreaking(BlockStateInterface bsi, int x, int y, int z, IBlockState state) {
|
||||||
Block b = state.getBlock();
|
Block b = state.getBlock();
|
||||||
return b == Blocks.ICE // ice becomes water, and water can mess up the path
|
return Baritone.settings().blocksToAvoidBreaking.value.contains(b)
|
||||||
|
|| b == Blocks.ICE // ice becomes water, and water can mess up the path
|
||||||
|| b instanceof BlockSilverfish // obvious reasons
|
|| b instanceof BlockSilverfish // obvious reasons
|
||||||
// call context.get directly with x,y,z. no need to make 5 new BlockPos for no reason
|
// 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)
|
|| avoidAdjacentBreaking(bsi, x, y + 1, z, true)
|
||||||
|
@ -165,7 +165,7 @@ public class ToolSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double avoidanceMultiplier(Block b) {
|
private double avoidanceMultiplier(Block b) {
|
||||||
return Baritone.settings().blocksToAvoidBreaking.value.contains(b) ? Baritone.settings().avoidBreakingMeansNever.value ? 0 : 0.1 : 1;
|
return Baritone.settings().blocksToDiscourageBreaking.value.contains(b) ? Baritone.settings().discourageBreakingMultiplier.value : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user