mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Make the maximum for the horizontal buffer configurable (sf).
This commit is contained in:
parent
6f78eba4c4
commit
f87307562b
|
@ -169,6 +169,8 @@ public class MovingConfig extends ACheckConfig {
|
|||
public final double sfHoverViolation;
|
||||
|
||||
// Special tolerance values:
|
||||
/** Horizontal buffer (rather sf), after failure leniency. */
|
||||
public final double hBufMax;
|
||||
/** Number of moving packets until which a velocity entry must be activated, in order to not be removed.*/
|
||||
public final int velocityActivationCounter;
|
||||
/** Server ticks until invalidating queues velocity. */
|
||||
|
@ -297,6 +299,7 @@ public class MovingConfig extends ACheckConfig {
|
|||
sfHoverFallDamage = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE);
|
||||
sfHoverViolation = config.getDouble(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION);
|
||||
|
||||
hBufMax = config.getDouble(ConfPaths.MOVING_SURVIVALFLY_HBUFMAX);
|
||||
velocityActivationCounter = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONCOUNTER);
|
||||
velocityActivationTicks = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONTICKS);
|
||||
velocityStrictInvalidation = config.getBoolean(ConfPaths.MOVING_VELOCITY_STRICTINVALIDATION);
|
||||
|
|
|
@ -56,9 +56,6 @@ public class Magic {
|
|||
public static final double modIce = 2.5D; //
|
||||
/** Faster moving down stream (water mainly). */
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim);
|
||||
/** Maximal horizontal buffer. It can be higher, but normal resetting should keep this limit. */
|
||||
|
||||
public static final double hBufMax = 1.0;
|
||||
|
||||
/**
|
||||
* Somewhat arbitrary horizontal speed gain maximum for advance glide phase.
|
||||
|
|
|
@ -422,9 +422,9 @@ public class SurvivalFly extends Check {
|
|||
}
|
||||
|
||||
// Finally check horizontal buffer regain.
|
||||
if (hDistanceAboveLimit < 0.0 && result <= 0.0 && !isSamePos && data.sfHorizontalBuffer < Magic.hBufMax) {
|
||||
if (hDistanceAboveLimit < 0.0 && result <= 0.0 && !isSamePos && data.sfHorizontalBuffer < cc.hBufMax) {
|
||||
// TODO: max min other conditions ?
|
||||
hBufRegain(hDistance, Math.min(0.2, Math.abs(hDistanceAboveLimit)), data);
|
||||
hBufRegain(hDistance, Math.min(0.2, Math.abs(hDistanceAboveLimit)), data, cc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1574,7 +1574,8 @@ public class SurvivalFly extends Check {
|
|||
* @param amount Positive amount.
|
||||
* @param data
|
||||
*/
|
||||
private void hBufRegain(final double hDistance, final double amount, final MovingData data) {
|
||||
private void hBufRegain(final double hDistance, final double amount,
|
||||
final MovingData data, final MovingConfig cc) {
|
||||
/*
|
||||
* TODO: Consider different concepts:
|
||||
* - full resetting with harder conditions.
|
||||
|
@ -1582,7 +1583,7 @@ public class SurvivalFly extends Check {
|
|||
* - reset or regain only every x blocks h distance.
|
||||
*/
|
||||
// TODO: Confine general conditions for buffer regain further (regain in air, whatever)?
|
||||
data.sfHorizontalBuffer = Math.min(Magic.hBufMax, data.sfHorizontalBuffer + amount);
|
||||
data.sfHorizontalBuffer = Math.min(cc.hBufMax, data.sfHorizontalBuffer + amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -620,6 +620,7 @@ public abstract class ConfPaths {
|
|||
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_STEPHEIGHT = MOVING_SURVIVALFLY + "stepheight";
|
||||
public static final String MOVING_SURVIVALFLY_HBUFMAX = MOVING_SURVIVALFLY + "hbufmax";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREEZE = MOVING_SURVIVALFLY + "vlfreeze";
|
||||
public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions";
|
||||
|
||||
|
|
|
@ -431,6 +431,7 @@ public class DefaultConfig extends ConfigFile {
|
|||
set(ConfPaths.MOVING_SURVIVALFLY_CHECK, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_STEPHEIGHT, "default");
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HBUFMAX, 1.0);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, "log:flyshort:3:10:f cancel vl>100 log:flyshort:0:10:if cancel vl>400 log:flylong:0:5:cif cancel vl>1500 log:flylong:0:5:cif cancel cmd:kickfly");
|
||||
|
|
Loading…
Reference in New Issue
Block a user