Reset stats when they are reported to metrics, that way it doesn't randomly accumulate and then reset.

This commit is contained in:
Adam committed 2012-05-15 22:57:31 -04:00
1 parent 8f840f78c5
commit 9d7d9235fa
2 files changed
+7 -6

No files matched your search

@@ -165,6 +165,7 @@ public class Anticheat extends JavaPlugin
return listener.getCheats(type);
}
});
listener.resetCheck(type);
}
metrics.start();
}
@@ -45,12 +45,12 @@ public class EventListener implements Listener
private void logCheat(CheckType type)
{
int x = 0;
if(usageList.get(type) != null)
{
x = usageList.get(type);
}
usageList.put(type, x+1);
usageList.put(type, getCheats(type)+1);
}
public void resetCheck(CheckType type)
{
usageList.put(type, 0);
}
public int getCheats(CheckType type)