reformatted and fixed stuck on break fall
This commit is contained in:
parent
c486d8241e
commit
6702b44b3e
@ -78,7 +78,7 @@ public class MovementFall extends Movement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BlockPos playerFeet = ctx.playerFeet();
|
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;
|
Rotation targetRotation = null;
|
||||||
Block destBlock = ctx.world().getBlockState(dest).getBlock();
|
Block destBlock = ctx.world().getBlockState(dest).getBlock();
|
||||||
boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER;
|
boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER;
|
||||||
@ -141,7 +141,7 @@ public class MovementFall extends Movement {
|
|||||||
}
|
}
|
||||||
if (targetRotation == null) {
|
if (targetRotation == null) {
|
||||||
Vec3d destCenterOffset = new Vec3d(destCenter.x + 0.125 * avoid.getX(), destCenter.y, destCenter.z + 0.125 * avoid.getZ());
|
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;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ public class MovementPillar extends Movement {
|
|||||||
IBlockState fromDown = BlockStateInterface.get(ctx, src);
|
IBlockState fromDown = BlockStateInterface.get(ctx, src);
|
||||||
if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) {
|
if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) {
|
||||||
// stay centered while swimming up a water column
|
// 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);
|
Vec3d destCenter = VecUtils.getBlockPosCenter(dest);
|
||||||
if (Math.abs(ctx.player().posX - destCenter.x) > 0.2 || Math.abs(ctx.player().posZ - destCenter.z) > 0.2) {
|
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);
|
state.setInput(Input.MOVE_FORWARD, true);
|
||||||
|
@ -479,6 +479,9 @@ public class PathExecutor implements IPathExecutor, Helper {
|
|||||||
if (dir.getY() < -3) {
|
if (dir.getY() < -3) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!movement.toBreakCached.isEmpty()) {
|
||||||
|
return null; // it's breaking
|
||||||
|
}
|
||||||
Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ());
|
Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ());
|
||||||
int i;
|
int i;
|
||||||
outer:
|
outer:
|
||||||
|
Loading…
Reference in New Issue
Block a user