Skip to content

Commit

Permalink
Workaround for jumping onto flower pots.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Feb 8, 2013
1 parent d3966b3 commit 409f5e5
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -494,7 +494,7 @@ private boolean lostGround(final Player player, final PlayerLocation from, final
}
final double setBackYDistance = to.getY() - data.getSetBackY();

// TODO: Check for sprinting down blocks etc.
// Check for sprinting down blocks etc.
if (!useWorkaround && yDistance <= 0.0 && Math.abs(yDistance) <= 0.5 && data.sfLastYDist <= yDistance && data.sfJumpPhase <= 7 && setBackYDistance < 0){
// TODO: <= 7 might work with speed II, not sure with above.
// TODO: account for speed/sprint
Expand All @@ -506,6 +506,16 @@ private boolean lostGround(final Player player, final PlayerLocation from, final
}
}

// Check for jumping up strange blocks like flower pots on top of other blocks.
if (!useWorkaround && yDistance == 0 && data.sfLastYDist > 0 && data.sfLastYDist < 0.25 && data.sfJumpPhase <= 6 + data.jumpAmplifier * 3 && setBackYDistance > 0 && setBackYDistance < 1.5 + 0.2 * data.jumpAmplifier){
// TODO: confine by block types ?
if (from.isOnGround(0.6, 0.4, 0, 0L) ){
// Temporary "fix".
useWorkaround = true;
setBackSafe = true;
}
}

// Interpolation check.
// TODO: Check if the set-back distance still has relevance.
// TODO: Interpolation might also be necessary between from and to !
Expand Down

0 comments on commit 409f5e5

Please sign in to comment.