mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-27 18:01:33 +01:00
SF + set-back policy: Set back to void, group "falldamage" here.
This commit is contained in:
parent
2151d9d365
commit
c9df8238f7
@ -131,7 +131,8 @@ public class MovingConfig extends ACheckConfig {
|
||||
public final boolean survivalFlyCobwebHack;
|
||||
public final boolean survivalFlyAccountingH;
|
||||
public final boolean survivalFlyAccountingV;
|
||||
public final boolean sfFallDamage;
|
||||
public final boolean sfSetBackPolicyVoid;
|
||||
public final boolean sfSetBackPolicyFallDamage;
|
||||
public final boolean sfBedStep;
|
||||
public final long survivalFlyVLFreeze;
|
||||
public final ActionList survivalFlyActions;
|
||||
@ -229,7 +230,8 @@ public class MovingConfig extends ACheckConfig {
|
||||
survivalFlyCobwebHack = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_COBWEBHACK, true);
|
||||
survivalFlyAccountingH = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false);
|
||||
survivalFlyAccountingV = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC);
|
||||
sfFallDamage = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_FALLDAMAGE);
|
||||
sfSetBackPolicyFallDamage = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE);
|
||||
sfSetBackPolicyVoid = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID);
|
||||
AlmostBoolean bedStep = config.getAlmostBoolean(ConfPaths.MOVING_SURVIVALFLY_BEDSTEP, AlmostBoolean.MAYBE);
|
||||
if (bedStep == AlmostBoolean.MAYBE) {
|
||||
sfBedStep = ServerVersion.select("1.8", false, true, true, true);
|
||||
|
@ -252,7 +252,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
// TODO: Add something to guess the best set back location (possibly data.guessSetBack(Location)).
|
||||
target = LocUtil.clone(loc);
|
||||
}
|
||||
if (sfCheck && cc.sfFallDamage && noFall.isEnabled(player)) {
|
||||
if (sfCheck && cc.sfSetBackPolicyFallDamage && noFall.isEnabled(player)) {
|
||||
// Check if to deal damage.
|
||||
double y = loc.getY();
|
||||
if (data.hasSetBack()) y = Math.min(y, data.getSetBackY());
|
||||
@ -586,7 +586,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (checkNf && cc.sfFallDamage) {
|
||||
if (checkNf && cc.sfSetBackPolicyFallDamage) {
|
||||
if (noFall.estimateDamage(player, from.getY(), data) < 1.0) {
|
||||
// TODO: Consider making this / damage amount configurable.
|
||||
mightSkipNoFall = true;
|
||||
|
@ -534,6 +534,9 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
else {
|
||||
data.sfJumpPhase++;
|
||||
if (to.getY() < 0.0 && cc.sfSetBackPolicyVoid) {
|
||||
data.setSetBack(to);
|
||||
}
|
||||
}
|
||||
|
||||
// Horizontal velocity invalidation.
|
||||
|
@ -563,7 +563,9 @@ public abstract class ConfPaths {
|
||||
private static final String MOVING_SURVIVALFLY_EXTENDED = MOVING_SURVIVALFLY + "extended.";
|
||||
public static final String MOVING_SURVIVALFLY_EXTENDED_HACC = MOVING_SURVIVALFLY_EXTENDED + "horizontal-accounting";
|
||||
public static final String MOVING_SURVIVALFLY_EXTENDED_VACC = MOVING_SURVIVALFLY_EXTENDED + "vertical-accounting";
|
||||
public static final String MOVING_SURVIVALFLY_FALLDAMAGE = MOVING_SURVIVALFLY + "falldamage";
|
||||
private static final String MOVING_SURVIVALFLY_SETBACKPOLICY = MOVING_SURVIVALFLY + "setbackpolicy.";
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE = MOVING_SURVIVALFLY_SETBACKPOLICY + "falldamage";
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID = MOVING_SURVIVALFLY_SETBACKPOLICY + "voidtovoid";
|
||||
public static final String MOVING_SURVIVALFLY_BEDSTEP = MOVING_SURVIVALFLY + "bedstep";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREEZE = MOVING_SURVIVALFLY + "vlfreeze";
|
||||
public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions";
|
||||
@ -650,7 +652,7 @@ public abstract class ConfPaths {
|
||||
|
||||
public static final String COMPATIBILITY_BLOCKS = COMPATIBILITY + "blocks.";
|
||||
|
||||
// Deprecated (don't use fields from above).
|
||||
// Moved paths.
|
||||
@Moved(newPath = LOGGING_BACKEND_CONSOLE_ACTIVE)
|
||||
public static final String LOGGING_CONSOLE = "logging.console";
|
||||
@Moved(newPath = LOGGING_BACKEND_FILE_ACTIVE)
|
||||
@ -685,6 +687,9 @@ public abstract class ConfPaths {
|
||||
public static final String MOVING_CREATIVEFLY_VERTICALSPEED = "checks.moving.creativefly.verticalspeed";
|
||||
@Moved(newPath = MOVING_CREATIVEFLY_MODEL + "creative." + SUB_MAXHEIGHT)
|
||||
public static final String MOVING_CREATIVEFLY_MAXHEIGHT = "checks.moving.creativefly.maxheight";
|
||||
@Moved(newPath = MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE)
|
||||
public static final String MOVING_SURVIVALFLY_FALLDAMAGE = "checks.moving.survivalfly.falldamage";
|
||||
// Deprecated paths (just removed).
|
||||
@Deprecated
|
||||
public static final String MISCELLANEOUS_REPORTTOMETRICS = "miscellaneous.reporttometrics";
|
||||
@Deprecated
|
||||
|
@ -400,8 +400,9 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_CHECK, true);
|
||||
// set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_FALLDAMAGE, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_BEDSTEP, "default");
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, true);
|
||||
// The settings aren't enabled by default. Simply write them yourself in the configuration file.
|
||||
// set(ConfPaths.MOVING_SURVIVALFLY_BLOCKINGSPEED, 100);
|
||||
// set(ConfPaths.MOVING_SURVIVALFLY_SNEAKINGSPEED, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user