mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Distinguish method by Minecraft version. Skip packet level pre-1.9.
This commit is contained in:
parent
5be2f45ba7
commit
f221086729
|
@ -346,7 +346,16 @@ public class MovingConfig extends ACheckConfig {
|
|||
));
|
||||
final PlayerSetBackMethod playerSetBackMethod = PlayerSetBackMethod.fromString(
|
||||
"extern.fromconfig", config.getString(ConfPaths.MOVING_SETBACK_METHOD));
|
||||
this.playerSetBackMethod = playerSetBackMethod.doesThisMakeSense() ? playerSetBackMethod : PlayerSetBackMethod.CAUTIOUS;
|
||||
if (playerSetBackMethod.doesThisMakeSense()) {
|
||||
this.playerSetBackMethod = playerSetBackMethod;
|
||||
}
|
||||
else if (ServerVersion.compareMinecraftVersion("1.9") < 0) {
|
||||
this.playerSetBackMethod = PlayerSetBackMethod.LEGACY;
|
||||
}
|
||||
else {
|
||||
// Latest.
|
||||
this.playerSetBackMethod = PlayerSetBackMethod.CAUTIOUS;
|
||||
}
|
||||
|
||||
traceMaxAge = config.getInt(ConfPaths.MOVING_TRACE_MAXAGE, 200);
|
||||
traceMaxSize = config.getInt(ConfPaths.MOVING_TRACE_MAXSIZE, 200);
|
||||
|
@ -380,6 +389,7 @@ public class MovingConfig extends ACheckConfig {
|
|||
catch (IllegalArgumentException e) {}
|
||||
}
|
||||
|
||||
|
||||
// Messages.
|
||||
msgKickIllegalMove = ColorUtil.replaceColors(config.getString(ConfPaths.MOVING_MESSAGE_ILLEGALPLAYERMOVE));
|
||||
msgKickIllegalVehicleMove = ColorUtil.replaceColors(config.getString(ConfPaths.MOVING_MESSAGE_ILLEGALVEHICLEMOVE));
|
||||
|
|
|
@ -447,7 +447,7 @@ public class MovingUtil {
|
|||
// TODO: Consider to skip checking for packet level, if not available (plus optimize access).
|
||||
// TODO: Consider a config flag, so this can be turned off (set back method).
|
||||
final PlayerSetBackMethod method = MovingConfig.getConfig(player).playerSetBackMethod;
|
||||
if (method.shouldCancel() || method.shouldSetTo()) {
|
||||
if ((method.shouldCancel() || method.shouldSetTo()) && method.shouldUpdateFrom()) {
|
||||
/*
|
||||
* Another leniency option: Skip, if we have already received an
|
||||
* ACK for this position on packet level.
|
||||
|
|
Loading…
Reference in New Issue
Block a user