From c902b5d249b7cbf46effa55c113a8c4fb66cb72b Mon Sep 17 00:00:00 2001 From: Evenprime Date: Sun, 19 Feb 2012 00:22:28 +0100 Subject: [PATCH] Fixed not working cancelling of move events. --- .../nocheat/checks/moving/MovingCheckListener.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java index e2a5719f..3a7d3f4f 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java @@ -192,6 +192,10 @@ public class MovingCheckListener implements Listener, EventManager { if(event.isCancelled() || event.getPlayer().isInsideVehicle() || event.getPlayer().isDead()) return; + if(!event.getFrom().getWorld().equals(event.getTo().getWorld()) || event.getFrom().distanceSquared(event.getTo()) > 400) { + return; + } + final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); final MovingConfig cc = MovingCheck.getConfig(player.getConfigurationStore()); @@ -206,6 +210,9 @@ public class MovingCheckListener implements Listener, EventManager { data.from.set(event.getFrom()); final Location to = event.getTo(); data.to.set(to); + + + PreciseLocation newTo = null; @@ -226,7 +233,7 @@ public class MovingCheckListener implements Listener, EventManager { /** MOREPACKETS CHECK SECTION **/ if(!cc.morePacketsCheck || player.hasPermission(Permissions.MOVING_MOREPACKETS)) { data.clearMorePacketsData(); - } else if(newTo != null) { + } else if(newTo == null) { newTo = morePacketsCheck.check(player, data, cc); }