Skip to content

Commit

Permalink
tentative fix to descend, needs testing
Browse files Browse the repository at this point in the history
  • Loading branch information
leijurv committed Feb 28, 2019
1 parent e767e34 commit a4237bf
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ public MovementState updateState(MovementState state) {
}

BlockPos playerFeet = ctx.playerFeet();
if (playerFeet.equals(dest) && (MovementHelper.isLiquid(ctx, dest) || ctx.player().posY - playerFeet.getY() < 0.094)) { // lilypads
BlockPos fakeDest = new BlockPos(dest.getX() * 2 - src.getX(), dest.getY(), dest.getZ() * 2 - src.getZ());
if ((playerFeet.equals(dest) || playerFeet.equals(fakeDest)) && (MovementHelper.isLiquid(ctx, dest) || ctx.player().posY - dest.getY() < 0.5)) { // lilypads
// Wait until we're actually on the ground before saying we're done because sometimes we continue to fall if the next action starts immediately
return state.setStatus(MovementStatus.SUCCESS);
/* else {
Expand All @@ -228,12 +229,8 @@ public MovementState updateState(MovementState state) {
double z = ctx.player().posZ - (src.getZ() + 0.5);
double fromStart = Math.sqrt(x * x + z * z);
if (!playerFeet.equals(dest) || ab > 0.25) {
BlockPos fakeDest = new BlockPos(dest.getX() * 2 - src.getX(), dest.getY(), dest.getZ() * 2 - src.getZ());
if (numTicks++ < 20) {
if (numTicks++ < 20 && fromStart < 1.25) {
MovementHelper.moveTowards(ctx, state, fakeDest);
if (fromStart > 1.25) {
state.getTarget().rotation = new Rotation(state.getTarget().rotation.getYaw() + 180F, state.getTarget().rotation.getPitch());
}
} else {
MovementHelper.moveTowards(ctx, state, dest);
}
Expand Down

1 comment on commit a4237bf

@leijurv
Copy link
Member Author

@leijurv leijurv commented on a4237bf Mar 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw if you were wondering why this was necessary, this is the horrifying issue it fixed https://youtu.be/p1Kc7b5cyFg?t=180

thanks to a completely random bridge on constantiam for having this exact pattern of blocks, and thanks to the respawn RNG for putting me in the exact right place to have this happen to me twice before i realized that it was something about that location and not just a completely random sideways jump glitch

Please sign in to comment.