small cleanup

This commit is contained in:
Leijurv 2019-04-25 11:22:11 -07:00
parent 30469e2de2
commit 36858ca219
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ public final class RotationUtils {
*/ */
public static Optional<Rotation> reachable(EntityPlayerSP entity, BlockPos pos, double blockReachDistance) { public static Optional<Rotation> reachable(EntityPlayerSP entity, BlockPos pos, double blockReachDistance) {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(entity); IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(entity);
if (pos.equals(baritone.getPlayerContext().getSelectedBlock().orElse(null))) { if (baritone.getPlayerContext().isLookingAt(pos)) {
/* /*
* why add 0.0001? * why add 0.0001?
* to indicate that we actually have a desired pitch * to indicate that we actually have a desired pitch

View File

@ -153,7 +153,7 @@ public abstract class Movement implements IMovement, MovementHelper {
Rotation rotTowardsBlock = reachable.get(); Rotation rotTowardsBlock = reachable.get();
MovementHelper.switchToBestToolFor(ctx, BlockStateInterface.get(ctx, blockPos)); MovementHelper.switchToBestToolFor(ctx, BlockStateInterface.get(ctx, blockPos));
state.setTarget(new MovementState.MovementTarget(rotTowardsBlock, true)); 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); state.setInput(Input.CLICK_LEFT, true);
} }
return false; return false;

View File

@ -313,7 +313,7 @@ public class MovementTraverse extends Movement {
} else { } else {
state.setTarget(new MovementState.MovementTarget(backToFace, true)); 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 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()); // Out.log("Trying to look at " + goalLook + ", actually looking at" + Baritone.whatAreYouLookingAt());