mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-24 12:16:46 +01:00
[Bleeding] ActionFrequency + System time running backwards.
This commit is contained in:
parent
fc7f738de7
commit
586ea509d2
@ -212,11 +212,16 @@ public class HookFacadeImpl implements HookFacade, NCPHook {
|
||||
|
||||
protected void cleanupLastBreaks() {
|
||||
final long ts = System.currentTimeMillis();
|
||||
if (ts - lastBreakCleanup < 30000) return;
|
||||
if (ts - lastBreakCleanup < 30000 && ts > lastBreakCleanup) return;
|
||||
lastBreakCleanup = ts;
|
||||
final List<String> rem = new LinkedList<String>();
|
||||
for (final Entry<String, ActionFrequency> entry : lastBreak.entrySet()){
|
||||
if (entry.getValue().score(1f) == 0f) rem.add(entry.getKey());
|
||||
if (ts >= lastBreakCleanup){
|
||||
for (final Entry<String, ActionFrequency> entry : lastBreak.entrySet()){
|
||||
if (entry.getValue().score(1f) == 0f) rem.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
else{
|
||||
rem.addAll(lastBreak.keySet());
|
||||
}
|
||||
for (final String key :rem){
|
||||
lastBreak.remove(key);
|
||||
|
Loading…
Reference in New Issue
Block a user