mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-14 16:08:34 +02:00
Add "strict" flag to blockbreak.fastbreak.
This allows to count break...break instead of interact...break, if set to false.
This commit is contained in:
parent
a823e6dd1e
commit
f9d44cd661
@ -75,6 +75,7 @@ public class BlockBreakConfig extends ACheckConfig {
|
|||||||
public final ActionList directionActions;
|
public final ActionList directionActions;
|
||||||
|
|
||||||
public final boolean fastBreakCheck;
|
public final boolean fastBreakCheck;
|
||||||
|
public final boolean fastBreakStrict;
|
||||||
public final boolean fastBreakDebug;
|
public final boolean fastBreakDebug;
|
||||||
public final int fastBreakBuckets;
|
public final int fastBreakBuckets;
|
||||||
public final long fastBreakBucketDur;
|
public final long fastBreakBucketDur;
|
||||||
@ -122,7 +123,7 @@ public class BlockBreakConfig extends ACheckConfig {
|
|||||||
|
|
||||||
// Fastbreak.
|
// Fastbreak.
|
||||||
fastBreakCheck = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK);
|
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);
|
fastBreakDebug = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false);
|
||||||
fastBreakDelay = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY);
|
fastBreakDelay = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY);
|
||||||
fastBreakGrace = Math.max(data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, 2000), data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE));
|
fastBreakGrace = Math.max(data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, 2000), data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE));
|
||||||
|
@ -59,7 +59,16 @@ public class FastBreak extends Check {
|
|||||||
else
|
else
|
||||||
breakingTime = Math.round((double) cc.fastBreakModSurvival / 100D * (double) BlockProperties.getBreakingDuration(id, player));
|
breakingTime = Math.round((double) cc.fastBreakModSurvival / 100D * (double) BlockProperties.getBreakingDuration(id, player));
|
||||||
// fastBreakfirstDamage is the first interact on block (!).
|
// 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.
|
// Check if the time used time is lower than expected.
|
||||||
// if (isInstaBreak){
|
// if (isInstaBreak){
|
||||||
|
@ -79,6 +79,7 @@ public abstract class ConfPaths {
|
|||||||
|
|
||||||
private static final String BLOCKBREAK_FASTBREAK = BLOCKBREAK + "fastbreak.";
|
private static final String BLOCKBREAK_FASTBREAK = BLOCKBREAK + "fastbreak.";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_CHECK = BLOCKBREAK_FASTBREAK + "active";
|
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";
|
public static final String BLOCKBREAK_FASTBREAK_DEBUG = BLOCKBREAK_FASTBREAK + "debug";
|
||||||
private static final String BLOCKBREAK_FASTBREAK_BUCKETS = BLOCKBREAK + "buckets.";
|
private static final String BLOCKBREAK_FASTBREAK_BUCKETS = BLOCKBREAK + "buckets.";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION = BLOCKBREAK_FASTBREAK_BUCKETS + "contention";
|
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION = BLOCKBREAK_FASTBREAK_BUCKETS + "contention";
|
||||||
|
@ -25,7 +25,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
* NCP build needed for this config.
|
* NCP build needed for this config.
|
||||||
* (Should only increment with changing or removing paths.)
|
* (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.
|
* 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_DIRECTION_ACTIONS, "cancel vl>10 log:bdirection:0:5:if cancel");
|
||||||
|
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, true);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, true);
|
||||||
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_STRICT, true);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 90);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 90);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000);
|
||||||
|
Loading…
Reference in New Issue
Block a user