Damnit citizens

This commit is contained in:
h31ix committed 2012-12-16 14:22:08 -05:00
1 parent e2a325e861
commit c76b462199
1 file changed
+12
@@ -50,11 +50,15 @@ public class EventListener implements Listener
{ {
USAGE_LIST.put(type, getCheats(type) + 1); USAGE_LIST.put(type, getCheats(type) + 1);
type.logUse(user.getName()); type.logUse(user.getName());
// Ignore plugins that are creating NPCs with no names (why the hell)
if(user.getName() != null)
{
if (Anticheat.getManager().getConfiguration().getFileLogLevel() == 2 && type.getUses(user.getName()) % 10 == 0) if (Anticheat.getManager().getConfiguration().getFileLogLevel() == 2 && type.getUses(user.getName()) % 10 == 0)
{ {
Anticheat.getManager().fileLog(user.getName() + " has triggered multiple " + type + " checks."); Anticheat.getManager().fileLog(user.getName() + " has triggered multiple " + type + " checks.");
} }
} }
}
public void resetCheck(CheckType type) public void resetCheck(CheckType type)
{ {
@@ -74,6 +78,9 @@ public class EventListener implements Listener
private static void removeDecrease(User user) private static void removeDecrease(User user)
{ {
int x = 0; int x = 0;
// Ignore plugins that are creating NPCs with no names
if(user.getName() != null)
{
if (DECREASE_LIST.get(user.getName()) != null) if (DECREASE_LIST.get(user.getName()) != null)
{ {
x = DECREASE_LIST.get(user.getName()); x = DECREASE_LIST.get(user.getName());
@@ -85,10 +92,14 @@ public class EventListener implements Listener
} }
DECREASE_LIST.put(user.getName(), x); DECREASE_LIST.put(user.getName(), x);
} }
}
public static void decrease(Player player) public static void decrease(Player player)
{ {
User user = getUserManager().getUser(player.getName()); User user = getUserManager().getUser(player.getName());
// Ignore plugins that are creating NPCs with no names
if(user.getName() != null)
{
int x = 0; int x = 0;
if (DECREASE_LIST.get(user.getName()) != null) if (DECREASE_LIST.get(user.getName()) != null)
{ {
@@ -102,6 +113,7 @@ public class EventListener implements Listener
DECREASE_LIST.put(user.getName(), 0); DECREASE_LIST.put(user.getName(), 0);
} }
} }
}
public static CheckManager getCheckManager() public static CheckManager getCheckManager()
{ {