diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java index d7593fc2..e0746ebe 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java @@ -145,6 +145,7 @@ public class MovingConfig extends ACheckConfig { public final boolean tempKickIllegal; public final boolean loadChunksOnJoin; public final long sprintingGrace; + public final boolean assumeSprint; public final int speedGrace; public final boolean vehicleEnforceLocation; public final boolean vehiclePreventDestroyOwn; @@ -221,6 +222,7 @@ public class MovingConfig extends ACheckConfig { tempKickIllegal = config.getBoolean(ConfPaths.MOVING_TEMPKICKILLEGAL); loadChunksOnJoin = config.getBoolean(ConfPaths.MOVING_LOADCHUNKS_JOIN); sprintingGrace = Math.max(0L, (long) (config.getDouble(ConfPaths.MOVING_SPRINTINGGRACE) * 1000.0)); // Config: seconds. + assumeSprint = config.getBoolean(ConfPaths.MOVING_ASSUMESPRINT); speedGrace = Math.max(0, (int) Math.round(config.getDouble(ConfPaths.MOVING_SPEEDGRACE) * 20.0)); // Config: seconds vehicleEnforceLocation = config.getBoolean(ConfPaths.MOVING_VEHICLES_ENFORCELOCATION); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 75b31467..6eec4264 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -479,8 +479,8 @@ public class MovingListener extends CheckListener implements TickListener, IRemo } final long time = System.currentTimeMillis(); - if (player.isSprinting()) { - // + if (player.isSprinting() || cc.assumeSprint) { + // Hard to confine assumesprint further (some logics change with hdist or sprinting). if (player.getFoodLevel() > 5) { data.timeSprinting = time; } 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 51aec121..ee812f9c 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 @@ -1439,6 +1439,7 @@ public class SurvivalFly extends Check { } if (player.isSleeping()) tags.add("sleeping"); if (player.getFoodLevel() <= 5 && player.isSprinting()) { + // Exception: does not take into account latency. tags.add("lowfoodsprint"); } if (!tags.isEmpty()) builder.append("\n" + " tags: " + StringUtil.join(tags, "+")); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java index cccff990..8cf039bb 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java @@ -640,6 +640,7 @@ public abstract class ConfPaths { private static final String MOVING_LOADCHUNKS = MOVING + "loadchunks."; public static final String MOVING_LOADCHUNKS_JOIN = MOVING_LOADCHUNKS + "join"; public static final String MOVING_SPRINTINGGRACE = MOVING + "sprintinggrace"; + public static final String MOVING_ASSUMESPRINT = MOVING + "assumesprint"; public static final String MOVING_SPEEDGRACE = MOVING + "speedgrace"; private static final String MOVING_VEHICLES = MOVING + "vehicles."; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java index 22c7610d..f82fcf55 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java @@ -410,15 +410,7 @@ public class DefaultConfig extends ConfigFile { set(ConfPaths.INVENTORY_OPEN_CLOSE, true); set(ConfPaths.INVENTORY_OPEN_CANCELOTHER, true); - /* - * e e ,e, - * d8b d8b e88 88e Y8b Y888P " 888 8e e88 888 - * e Y8b Y8b d888 888b Y8b Y8P 888 888 88b d888 888 - * d8b Y8b Y8b Y888 888P Y8b " 888 888 888 Y888 888 - * d888b Y8b Y8b "88 88" Y8P 888 888 888 "88 888 - * , 88P - * "8",P" - */ + // MOVING set(ConfPaths.MOVING_CREATIVEFLY_CHECK, true); set(ConfPaths.MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT, false); set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false); @@ -484,6 +476,7 @@ public class DefaultConfig extends ConfigFile { set(ConfPaths.MOVING_TEMPKICKILLEGAL, true); set(ConfPaths.MOVING_LOADCHUNKS_JOIN, true); set(ConfPaths.MOVING_SPRINTINGGRACE, 2.0); + set(ConfPaths.MOVING_ASSUMESPRINT, false); set(ConfPaths.MOVING_SPEEDGRACE, 4.0); /*