From e8d8341d3bfde030c6c652577d79bdd2e551c526 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Wed, 4 Jan 2012 20:44:13 +0100 Subject: [PATCH] Fix players getting drawn back to a really old location if they get, then lose the "moving" permission. Silently catch all exceptions in command execution that can't be handled anyway. --- src/cc/co/evenprime/bukkit/nocheat/checks/Check.java | 2 ++ .../bukkit/nocheat/checks/moving/MovingEventManager.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java b/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java index 2fe8d864..df2294ca 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java @@ -83,6 +83,8 @@ public abstract class Check { plugin.getServer().dispatchCommand(noCheatCommandSender, command); } catch(CommandException e) { System.out.println("[NoCheat] failed to execute the command '" + command + "': " + e.getMessage() + ", please check if everything is setup correct."); + } catch(Exception e) { + // I don't care in this case, your problem if your command fails } } }); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingEventManager.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingEventManager.java index dbd5d5ff..858a2f7b 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingEventManager.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingEventManager.java @@ -111,6 +111,9 @@ public class MovingEventManager extends EventManagerImpl { final CCMoving cc = MovingCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.MOVING)) { + // Just because he is allowed now, doesn't mean he will always + // be. So forget data about the player related to moving + player.getDataStore().get("moving").clearCriticalData(); return; }