diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/CreativeFly.java b/src/fr/neatmonster/nocheatplus/checks/moving/CreativeFly.java index faf3b3a1..1eda2538 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/CreativeFly.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/CreativeFly.java @@ -89,17 +89,17 @@ public class CreativeFly extends Check { // Finally, determine how far the player went beyond the set limits. double resultH = Math.max(0.0D, hDistance - data.horizontalFreedom - limitH); -// final boolean sprinting = player.isSprinting() && player.getFoodLevel() > 5; + final boolean sprinting = player.isSprinting() && player.getFoodLevel() > 5; -// data.bunnyhopDelay--; + data.bunnyhopDelay--; -// if (resultH > 0 && sprinting) -// // Try to treat it as a the "bunnyhop" problem. The bunnyhop problem is that landing and immediately jumping -// // again leads to a player moving almost twice as far in that step. -// if (data.bunnyhopDelay <= 0 && resultH < 0.4D) { -// data.bunnyhopDelay = 9; -// resultH = 0D; -// } + if (resultH > 0 && sprinting) + // Try to treat it as a the "bunnyhop" problem. The bunnyhop problem is that landing and immediately jumping + // again leads to a player moving almost twice as far in that step. + if (data.bunnyhopDelay <= 0 && resultH < 0.4D) { + data.bunnyhopDelay = 9; + resultH = 0D; + } resultH *= 100D; diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/MovingData.java b/src/fr/neatmonster/nocheatplus/checks/moving/MovingData.java index 708a6180..ea0008a7 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/MovingData.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/MovingData.java @@ -67,7 +67,7 @@ public class MovingData extends ACheckData { public double survivalFlyVL = 0D; // Data shared between the fly checks. -// public int bunnyhopDelay; + public int bunnyhopDelay; public double horizontalBuffer; public double horizontalFreedom; public double horizontalVelocityCounter; @@ -113,7 +113,7 @@ public class MovingData extends ACheckData { * Clear the data of the fly checks. */ public void clearFlyData() { -// bunnyhopDelay = 0; + bunnyhopDelay = 0; noFallFallDistance = 0D; survivalFlyJumpPhase = 0; setBack = null; diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index 3149c47a..07a94032 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -154,15 +154,15 @@ public class SurvivalFly extends Check { } } -// data.bunnyhopDelay--; + data.bunnyhopDelay--; -// // Did he go too far? -// if (hDistanceAboveLimit > 0 && sprinting) -// // Try to treat it as a the "bunnyhop" problem. -// if (data.bunnyhopDelay <= 0 && hDistanceAboveLimit > 0.05D && hDistanceAboveLimit < 0.28D) { -// data.bunnyhopDelay = 9; -// hDistanceAboveLimit = 0D; -// } + // Did he go too far? + if (hDistanceAboveLimit > 0 && sprinting) + // Try to treat it as a the "bunnyhop" problem. + if (data.bunnyhopDelay <= 0 && hDistanceAboveLimit > 0.05D && hDistanceAboveLimit < 0.28D) { + data.bunnyhopDelay = 9; + hDistanceAboveLimit = 0D; + } if (hDistanceAboveLimit > 0D) { // Try to consume the "buffer".