diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index e899ce636..6ccd449b4 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -36,6 +36,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import java.util.Objects; +import java.util.Optional; public class MovementPillar extends Movement { @@ -161,6 +162,7 @@ public class MovementPillar extends Movement { state.setInput(Input.MOVE_FORWARD, true); } if (ctx.playerFeet().equals(dest)) { + logDebug("wtf2"); return state.setStatus(MovementStatus.SUCCESS); } return state; @@ -183,6 +185,7 @@ public class MovementPillar extends Movement { } if (ctx.playerFeet().equals(against.up()) || ctx.playerFeet().equals(dest)) { + logDebug("wtf3"); return state.setStatus(MovementStatus.SUCCESS); } if (MovementHelper.isBottomSlab(BlockStateInterface.get(ctx, src.down()))) { @@ -226,8 +229,14 @@ public class MovementPillar extends Movement { if (!blockIsThere) { - Block fr = BlockStateInterface.get(ctx, src).getBlock(); - if (!(fr instanceof BlockAir || fr.isReplaceable(ctx.world(), src))) { + IBlockState frState = BlockStateInterface.get(ctx, src); + Block fr = frState.getBlock(); + // TODO: Evaluate usage of getMaterial().isReplaceable() + if (!(fr instanceof BlockAir || frState.getMaterial().isReplaceable())) { + Optional reachable = RotationUtils.reachable(ctx.player(), src, ctx.playerController().getBlockReachDistance()); + if (reachable.isPresent()) { + state.setTarget(new MovementState.MovementTarget(reachable.get(), true)); + } state.setInput(Input.CLICK_LEFT, true); blockIsThere = false; } else if (ctx.player().isSneaking() && (Objects.equals(src.down(), ctx.objectMouseOver().getBlockPos()) || Objects.equals(src, ctx.objectMouseOver().getBlockPos())) && ctx.player().posY > dest.getY() + 0.1) { diff --git a/src/main/java/baritone/process/CustomGoalProcess.java b/src/main/java/baritone/process/CustomGoalProcess.java index 2c8a3c339..0ec2ba78c 100644 --- a/src/main/java/baritone/process/CustomGoalProcess.java +++ b/src/main/java/baritone/process/CustomGoalProcess.java @@ -88,7 +88,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG onLostControl(); return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL); } - if (this.goal == null || this.goal.isInGoal(ctx.playerFeet())) { + if (this.goal == null || (this.goal.isInGoal(ctx.playerFeet()) && ctx.player().onGround)) { onLostControl(); // we're there xd return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL); } diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index a7a28db0b..e2c34dfd3 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -101,7 +101,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl CalculationContext context = new CalculationContext(baritone, true); Baritone.getExecutor().execute(() -> rescan(current, context)); } - if (goal.isInGoal(ctx.playerFeet()) && isSafeToCancel) { + if (goal.isInGoal(ctx.playerFeet()) && ctx.player().onGround && isSafeToCancel) { // we're there if (rightClickOnArrival(gettingTo)) { if (rightClick()) {