diff --git a/src/api/java/baritone/api/utils/RotationUtils.java b/src/api/java/baritone/api/utils/RotationUtils.java index 3010d283..e19f531d 100644 --- a/src/api/java/baritone/api/utils/RotationUtils.java +++ b/src/api/java/baritone/api/utils/RotationUtils.java @@ -154,7 +154,7 @@ public final class RotationUtils { */ public static Optional reachable(EntityPlayerSP entity, BlockPos pos, double blockReachDistance) { IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(entity); - if (pos.equals(baritone.getPlayerContext().getSelectedBlock().orElse(null))) { + if (baritone.getPlayerContext().isLookingAt(pos)) { /* * why add 0.0001? * to indicate that we actually have a desired pitch diff --git a/src/main/java/baritone/pathing/movement/Movement.java b/src/main/java/baritone/pathing/movement/Movement.java index 4bdd4f95..c9849cab 100644 --- a/src/main/java/baritone/pathing/movement/Movement.java +++ b/src/main/java/baritone/pathing/movement/Movement.java @@ -153,7 +153,7 @@ public abstract class Movement implements IMovement, MovementHelper { Rotation rotTowardsBlock = reachable.get(); MovementHelper.switchToBestToolFor(ctx, BlockStateInterface.get(ctx, blockPos)); state.setTarget(new MovementState.MovementTarget(rotTowardsBlock, true)); - if (Objects.equals(ctx.getSelectedBlock().orElse(null), blockPos) || ctx.playerRotations().isReallyCloseTo(rotTowardsBlock)) { + if (ctx.isLookingAt(blockPos) || ctx.playerRotations().isReallyCloseTo(rotTowardsBlock)) { state.setInput(Input.CLICK_LEFT, true); } return false; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 881571bc..4f7ae713 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -313,7 +313,7 @@ public class MovementTraverse extends Movement { } else { state.setTarget(new MovementState.MovementTarget(backToFace, true)); } - if (Objects.equals(ctx.getSelectedBlock().orElse(null), goalLook)) { + if (ctx.isLookingAt(goalLook)) { return state.setInput(Input.CLICK_RIGHT, true); // wait to right click until we are able to place } // Out.log("Trying to look at " + goalLook + ", actually looking at" + Baritone.whatAreYouLookingAt());