mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Accoutn for lag in chat.commands.
This commit is contained in:
parent
cce67ac67c
commit
6a70f0a010
@ -47,9 +47,15 @@ public class Commands extends Check {
|
|||||||
data.commandsShortTermWeight = 1.0;
|
data.commandsShortTermWeight = 1.0;
|
||||||
}
|
}
|
||||||
else if (tick - data.commandsShortTermTick < cc.commandsShortTermTicks){
|
else if (tick - data.commandsShortTermTick < cc.commandsShortTermTicks){
|
||||||
// TODO: account for lag.
|
if (!cc.lag || TickTask.getLag(50L * (tick - data.commandsShortTermTick), true) < 1.3f){
|
||||||
// Add up.
|
// Add up.
|
||||||
data.commandsShortTermWeight += weight;
|
data.commandsShortTermWeight += weight;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// Reset, too much lag.
|
||||||
|
data.commandsShortTermTick = tick;
|
||||||
|
data.commandsShortTermWeight = 1.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Reset.
|
// Reset.
|
||||||
|
Loading…
Reference in New Issue
Block a user