From aecf3a6f1f1c3c3df366d9cd4fe60fc6fee043b1 Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 30 Sep 2012 02:24:09 +0200 Subject: [PATCH] Bleeding: Adjust velocity handling for survivalfly. --- .../nocheatplus/checks/moving/MovingListener.java | 2 +- .../nocheatplus/checks/moving/SurvivalFly.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index f59566b9..e0237c1c 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -341,7 +341,7 @@ public class MovingListener implements Listener { data.verticalVelocityCounter--; if (data.verticalVelocityCounter > 0D) { data.verticalFreedom += data.verticalVelocity; - data.verticalVelocity *= 0.90D; + data.verticalVelocity *= 0.93D; } else if (data.verticalFreedom > 0.001D) // Counter has run out, now reduce the vertical freedom over time. data.verticalFreedom *= 0.93D; diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index f4972605..d9f9905e 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -209,6 +209,7 @@ public class SurvivalFly extends Check { if (!fromOnGround && (from.getY() < data.survivalFlyLastFromY && yDistance > 0D && yDistance < 0.5D && setBackYDistance > 0D && setBackYDistance <= 1.5D || !toOnGround && to.isAboveStairs())) { +// System.out.println("*** reset setback."); // Set the new setBack and reset the jumpPhase. data.setBack = from.getLocation(); data.setBack.setY(Math.floor(data.setBack.getY())); @@ -230,10 +231,14 @@ public class SurvivalFly extends Check { else{ vAllowedDistance = (!fromOnGround && !toOnGround ? 1.45D : 1.35D) + data.verticalFreedom; vAllowedDistance *= data.jumpAmplifier; - if (data.survivalFlyJumpPhase > 6 + data.jumpAmplifier) - vAllowedDistance -= (data.survivalFlyJumpPhase - 6) * 0.15D; + if (data.survivalFlyJumpPhase > 6 + data.jumpAmplifier && data.verticalVelocityCounter <= 0){ + vAllowedDistance -= (data.survivalFlyJumpPhase - 6) * 0.15D; +// System.out.println("jumpphase -> " + data.survivalFlyJumpPhase); + } vDistanceAboveLimit = to.getY() - data.setBack.getY() - vAllowedDistance; + +// System.out.println("vda = " +vDistanceAboveLimit + " / vc = " + data.verticalVelocityCounter + " / vf = " + data.verticalFreedom + " / v = " + player.getVelocity().length()); // Step can also be blocked. if (fromOnGround && toOnGround && Math.abs(to.getY() - from.getY() - 1D) <= cc.yStep && vDistanceAboveLimit <= 0D