diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java index 6f3c2a66..be260b56 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java @@ -121,6 +121,7 @@ public class MovingConfig extends ACheckConfig { public final int velocityGraceTicks; public final int velocityActivationCounter; public final int velocityActivationTicks; + public final boolean velocityStrictInvalidation; public final double noFallyOnGround; public final double yOnGround; public final double yStep; @@ -191,6 +192,7 @@ public class MovingConfig extends ACheckConfig { velocityGraceTicks = config.getInt(ConfPaths.MOVING_VELOCITY_GRACETICKS); velocityActivationCounter = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONCOUNTER); velocityActivationTicks = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONTICKS); + velocityStrictInvalidation = config.getBoolean(ConfPaths.MOVING_VELOCITY_STRICTINVALIDATION); yOnGround = config.getDouble(ConfPaths.MOVING_YONGROUND, 0.001, 2.0, 0.0626); // sqrt(1/256), see: NetServerHandler. noFallyOnGround = config.getDouble(ConfPaths.MOVING_NOFALL_YONGROUND, 0.001, 2.0, yOnGround); // ystep is set to 0.45 by default, for stairs / steps. diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index 7990321b..af9b3119 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -549,7 +549,8 @@ public class SurvivalFly extends Check { } // Check removal of active horizontal velocity. - if (hDistance <= hAllowedDistance){ // TODO: Check conditions etc. + if (hDistance <= (cc.velocityStrictInvalidation ? hAllowedDistance : hAllowedDistance / 2.0)){ + // TODO: Should there be other side conditions? // Invalidate used horizontal velocity. // System.out.println("*** INVALIDATE ON SPEED"); data.hVelActive.clear(); diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java index 33f9a684..5f421de7 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java @@ -565,6 +565,7 @@ public abstract class ConfPaths { public static final String MOVING_VELOCITY_GRACETICKS = MOVING_VELOCITY + "graceticks"; public static final String MOVING_VELOCITY_ACTIVATIONCOUNTER = MOVING_VELOCITY + "activationcounter"; public static final String MOVING_VELOCITY_ACTIVATIONTICKS = MOVING_VELOCITY + "activationticks"; + public static final String MOVING_VELOCITY_STRICTINVALIDATION = MOVING_VELOCITY + "strictinvalidation"; public static final String MOVING_NOFALL_YONGROUND = MOVING_NOFALL + "yonground"; public static final String MOVING_YONGROUND = MOVING + "yonground"; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java index 307e1189..e5dc409f 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java @@ -443,6 +443,7 @@ public class DefaultConfig extends ConfigFile { set(ConfPaths.MOVING_VELOCITY_GRACETICKS, 20); set(ConfPaths.MOVING_VELOCITY_ACTIVATIONCOUNTER, 80); set(ConfPaths.MOVING_VELOCITY_ACTIVATIONTICKS, 140); + set(ConfPaths.MOVING_VELOCITY_STRICTINVALIDATION, true); // General. set(ConfPaths.MOVING_TEMPKICKILLEGAL, true);