From fec29d03fd831b26740765f164a59afe95785316 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 10 Oct 2018 21:25:21 -0700 Subject: [PATCH] automatically break block while suffocating, fixes #33 --- src/main/java/baritone/pathing/movement/Movement.java | 3 +++ .../baritone/pathing/movement/movements/MovementPillar.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/pathing/movement/Movement.java b/src/main/java/baritone/pathing/movement/Movement.java index 92a1f4db..4b537ac5 100644 --- a/src/main/java/baritone/pathing/movement/Movement.java +++ b/src/main/java/baritone/pathing/movement/Movement.java @@ -116,6 +116,9 @@ public abstract class Movement implements IMovement, Helper, MovementHelper { if (BlockStateInterface.isLiquid(playerFeet())) { latestState.setInput(Input.JUMP, true); } + if (player().isEntityInsideOpaqueBlock()) { + latestState.setInput(Input.CLICK_LEFT, true); + } // If the movement target has to force the new rotations, or we aren't using silent move, then force the rotations latestState.getTarget().getRotation().ifPresent(rotation -> diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index a43fbe59..853b34d5 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -209,7 +209,7 @@ public class MovementPillar extends Movement { // If it's been more than forty ticks of trying to jump and we aren't done yet, go forward, maybe we are stuck state.setInput(InputOverrideHandler.Input.MOVE_FORWARD, true); } - + if (!blockIsThere) { Block fr = BlockStateInterface.get(src).getBlock();