From 6702b44b3ea4941884547e44d1baa0a3e4a2ef7f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 19 Feb 2019 12:43:44 -0800 Subject: [PATCH] reformatted and fixed stuck on break fall --- .../baritone/pathing/movement/movements/MovementFall.java | 4 ++-- .../baritone/pathing/movement/movements/MovementPillar.java | 2 +- src/main/java/baritone/pathing/path/PathExecutor.java | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index b0674887..93f60f5d 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -78,7 +78,7 @@ public class MovementFall extends Movement { } BlockPos playerFeet = ctx.playerFeet(); - Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations()); + Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest), ctx.playerRotations()); Rotation targetRotation = null; Block destBlock = ctx.world().getBlockState(dest).getBlock(); boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER; @@ -141,7 +141,7 @@ public class MovementFall extends Movement { } if (targetRotation == null) { Vec3d destCenterOffset = new Vec3d(destCenter.x + 0.125 * avoid.getX(), destCenter.y, destCenter.z + 0.125 * avoid.getZ()); - state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset,ctx.playerRotations()), false)); + state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset, ctx.playerRotations()), false)); } return state; } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index d8c03b12..d430f8c5 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -151,7 +151,7 @@ public class MovementPillar extends Movement { IBlockState fromDown = BlockStateInterface.get(ctx, src); if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) { // stay centered while swimming up a water column - state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations()), false)); + state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest), ctx.playerRotations()), false)); Vec3d destCenter = VecUtils.getBlockPosCenter(dest); if (Math.abs(ctx.player().posX - destCenter.x) > 0.2 || Math.abs(ctx.player().posZ - destCenter.z) > 0.2) { state.setInput(Input.MOVE_FORWARD, true); diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 1a221af3..44882b98 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -479,6 +479,9 @@ public class PathExecutor implements IPathExecutor, Helper { if (dir.getY() < -3) { return null; } + if (!movement.toBreakCached.isEmpty()) { + return null; // it's breaking + } Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ()); int i; outer: