diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakConfig.java index 4cbd2707..e5893834 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakConfig.java @@ -75,6 +75,7 @@ public class BlockBreakConfig extends ACheckConfig { public final ActionList directionActions; public final boolean fastBreakCheck; + public final boolean fastBreakStrict; public final boolean fastBreakDebug; public final int fastBreakBuckets; public final long fastBreakBucketDur; @@ -122,7 +123,7 @@ public class BlockBreakConfig extends ACheckConfig { // Fastbreak. fastBreakCheck = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK); - // Hidden settings of new check. + fastBreakStrict = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_STRICT); fastBreakDebug = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false); fastBreakDelay = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY); fastBreakGrace = Math.max(data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, 2000), data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE)); diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java index 2c2b881e..d707778d 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java @@ -59,7 +59,16 @@ public class FastBreak extends Check { else breakingTime = Math.round((double) cc.fastBreakModSurvival / 100D * (double) BlockProperties.getBreakingDuration(id, player)); // fastBreakfirstDamage is the first interact on block (!). - final long elapsedTime = (data.fastBreakBreakTime > data.fastBreakfirstDamage) ? 0 : now - data.fastBreakfirstDamage; + final long elapsedTime; + // TODO: Should it be breakingTime instead of 0 for inconsistencies? + if (cc.fastBreakStrict){ + // Counting interact...break. + elapsedTime = (data.fastBreakBreakTime > data.fastBreakfirstDamage) ? 0 : now - data.fastBreakfirstDamage; + } + else{ + // Counting break...break. + elapsedTime = (data.fastBreakBreakTime > now) ? 0 : now - data.fastBreakBreakTime; + } // Check if the time used time is lower than expected. // if (isInstaBreak){ 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 5e567920..abb776aa 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java @@ -79,6 +79,7 @@ public abstract class ConfPaths { private static final String BLOCKBREAK_FASTBREAK = BLOCKBREAK + "fastbreak."; public static final String BLOCKBREAK_FASTBREAK_CHECK = BLOCKBREAK_FASTBREAK + "active"; + public static final String BLOCKBREAK_FASTBREAK_STRICT = BLOCKBREAK_FASTBREAK + "strict"; public static final String BLOCKBREAK_FASTBREAK_DEBUG = BLOCKBREAK_FASTBREAK + "debug"; private static final String BLOCKBREAK_FASTBREAK_BUCKETS = BLOCKBREAK + "buckets."; public static final String BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION = BLOCKBREAK_FASTBREAK_BUCKETS + "contention"; 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 6a1e3ff8..61e391f4 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java @@ -25,7 +25,7 @@ public class DefaultConfig extends ConfigFile { * NCP build needed for this config. * (Should only increment with changing or removing paths.) */ - public static final int buildNumber = 284; + public static final int buildNumber = 299; /** * Instantiates a new default configuration. @@ -85,6 +85,7 @@ public class DefaultConfig extends ConfigFile { set(ConfPaths.BLOCKBREAK_DIRECTION_ACTIONS, "cancel vl>10 log:bdirection:0:5:if cancel"); set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, true); + set(ConfPaths.BLOCKBREAK_FASTBREAK_STRICT, true); set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 90); set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100); set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000);