add blocks to avoid breaking, fixes #368

This commit is contained in:
Leijurv 2019-04-22 19:52:04 -07:00
parent e8b4f4d2b6
commit 83265fcb54
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 9 additions and 1 deletions

View File

@ -157,6 +157,13 @@ public final class Settings {
// Leave Empty by Default
));
/**
* Blocks that Baritone is not allowed to break
*/
public final Setting<List<Block>> blocksToAvoidBreaking = new Setting<>(new ArrayList<>(
// e.g. crafting table, beds
));
/**
* Enables some more advanced vine features. They're honestly just gimmicks and won't ever be needed in real
* pathing scenarios. And they can cause Baritone to get trapped indefinitely in a strange scenario.

View File

@ -55,7 +55,8 @@ public interface MovementHelper extends ActionCosts, Helper {
|| bsi.get0(x + 1, y, z).getBlock() instanceof BlockLiquid
|| bsi.get0(x - 1, y, z).getBlock() instanceof BlockLiquid
|| bsi.get0(x, y, z + 1).getBlock() instanceof BlockLiquid
|| bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid;
|| bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid
|| Baritone.settings().blocksToAvoidBreaking.value.contains(b);
}
static boolean canWalkThrough(IPlayerContext ctx, BetterBlockPos pos) {