From 586ea509d262ab96586b8400de41240c988cd710 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 12 Jan 2013 20:47:53 +0100 Subject: [PATCH] [Bleeding] ActionFrequency + System time running backwards. --- .../asofold/bpl/cncp/hooks/mcmmo/HookFacadeImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/mcmmo/HookFacadeImpl.java b/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/mcmmo/HookFacadeImpl.java index fc7c4ba..67da92b 100644 --- a/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/mcmmo/HookFacadeImpl.java +++ b/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/mcmmo/HookFacadeImpl.java @@ -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 rem = new LinkedList(); - for (final Entry entry : lastBreak.entrySet()){ - if (entry.getValue().score(1f) == 0f) rem.add(entry.getKey()); + if (ts >= lastBreakCleanup){ + for (final Entry 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);