From f2f66c15724d6c920a9b22aa697cb6f8a7b21bc8 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 7 Sep 2015 00:23:45 +0200 Subject: [PATCH] Another special case bunny (@Iceee). --- .../neatmonster/nocheatplus/checks/moving/MovingData.java | 4 ++++ .../neatmonster/nocheatplus/checks/moving/SurvivalFly.java | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingData.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingData.java index 2af795df..e792e9df 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingData.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingData.java @@ -195,6 +195,8 @@ public class MovingData extends ACheckData { */ public double sfLastYDist = Double.MAX_VALUE; public double sfLastHDist = Double.MAX_VALUE; + public boolean sfLastAllowBunny = false; + public boolean sfThisAllowBunny = false; /** Counting while the player is not on ground and not moving. A value <0 means not hovering at all. */ public int sfHoverTicks = -1; /** First count these down before incrementing sfHoverTicks. Set on join, if configured so. */ @@ -252,6 +254,7 @@ public class MovingData extends ACheckData { mediumLiftOff = defaultMediumLiftOff; vehicleConsistency = MoveConsistency.INCONSISTENT; lastFrictionHorizontal = lastFrictionVertical = 0.0; + sfLastAllowBunny = sfThisAllowBunny = false; } /** @@ -285,6 +288,7 @@ public class MovingData extends ACheckData { removeAllVelocity(); vehicleConsistency = MoveConsistency.INCONSISTENT; // Not entirely sure here. lastFrictionHorizontal = lastFrictionVertical = 0.0; + sfLastAllowBunny = sfThisAllowBunny = false; } /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index 4ed8b0d1..2d3710e7 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -551,6 +551,8 @@ public class SurvivalFly extends Check { data.fromWasReset = resetFrom || data.noFallAssumeGround; data.lastFrictionHorizontal = data.nextFrictionHorizontal; data.lastFrictionVertical = data.nextFrictionVertical; + data.sfLastAllowBunny = data.sfThisAllowBunny; + data.sfThisAllowBunny = false; if (data.debug && tags.size() > tagsLength) { logPostViolationTags(player); } @@ -1088,7 +1090,8 @@ public class SurvivalFly extends Check { // TODO: Test bunny spike over all sorts of speeds + attributes. // TODO: Allow slightly higher speed on lost ground? if (data.mediumLiftOff != MediumLiftOff.LIMIT_JUMP // && yDistance >= 0.4 - && (data.sfJumpPhase == 0 && from.isOnGround() || data.sfJumpPhase <= 1 && data.noFallAssumeGround) + && (data.sfJumpPhase == 0 && from.isOnGround() || data.sfJumpPhase <= 1 && data.noFallAssumeGround + || data.sfLastAllowBunny) // TODO: Should probably still confine y-dist to set-back. && !from.isResetCond() && !to.isResetCond() || double_bunny ) { @@ -1335,6 +1338,7 @@ public class SurvivalFly extends Check { // TODO: confine by block types ? if (from.isOnGround(0.25, 0.4, 0, 0L) ) { // Temporary "fix". + data.sfThisAllowBunny = true; return applyLostGround(player, from, true, data, "ministep"); } }