From b821292bf29b95baea783a19e60b99088d21b037 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Sun, 13 Mar 2011 15:57:19 +0100 Subject: [PATCH] Readded "event.setCancelled(true);" for PLAYER_MOVE events, now that I know that this was not the reason for disappearing players. I wished cancelling move events would actually do what one would expect. --- src/cc/co/evenprime/bukkit/nocheat/NoCheatConfiguration.java | 2 +- src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java | 5 +++-- .../co/evenprime/bukkit/nocheat/checks/SpeedhackCheck.java | 5 ++--- .../bukkit/nocheat/listeners/NoCheatPlayerListener.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheatConfiguration.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheatConfiguration.java index 3f6ceb11..7629b84b 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheatConfiguration.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheatConfiguration.java @@ -184,7 +184,7 @@ public class NoCheatConfiguration { w.write(" low: loglow reset"); w.newLine(); w.write(" med: logmed reset"); w.newLine(); w.write(" high: loghigh reset"); w.newLine(); - w.write("# Moving specific optionse") ;w.newLine(); + w.write("# Moving specific options") ; w.newLine(); w.write("moving:"); w.newLine(); w.write("# After how many minor violations should the plugin react (minimum 1)"); w.newLine(); w.write(" freemoves: 5"); w.newLine(); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java index b453248e..d446bbb2 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java @@ -398,12 +398,13 @@ public class MovingCheck { event.setFrom(l); event.setTo(l); event.getPlayer().teleportTo(l); + event.setCancelled(true); } else { // Lets try it that way. Maybe now people don't "disappear" any longer - event.setFrom(event.getFrom()); event.setTo(event.getFrom().clone()); - event.getPlayer().teleportTo(event.getFrom()); + event.getPlayer().teleportTo(event.getFrom().clone()); + event.setCancelled(true); } } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/SpeedhackCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/SpeedhackCheck.java index 7b951e6a..4f0e63c3 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/SpeedhackCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/SpeedhackCheck.java @@ -89,16 +89,15 @@ public class SpeedhackCheck { Location l = data.speedhackSetBackPoint; // If we have stored a location for the player, we put him back there if(l != null) { - - // Lets try it that way. Maybe now people don't "disappear" any longer event.setFrom(l); event.setTo(l); + event.setCancelled(true); event.getPlayer().teleportTo(l); } else { - // Lets try it that way. Maybe now people don't "disappear" any longer event.setFrom(event.getFrom()); event.setTo(event.getFrom().clone()); + event.setCancelled(true); event.getPlayer().teleportTo(event.getFrom()); } } diff --git a/src/cc/co/evenprime/bukkit/nocheat/listeners/NoCheatPlayerListener.java b/src/cc/co/evenprime/bukkit/nocheat/listeners/NoCheatPlayerListener.java index 94965fe2..5a63af3d 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/listeners/NoCheatPlayerListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/listeners/NoCheatPlayerListener.java @@ -47,7 +47,7 @@ public class NoCheatPlayerListener extends PlayerListener { BedteleportCheck.check(event); } - if(!event.isCancelled()) { + if(!event.isCancelled()) { NoCheatData data = NoCheatPlugin.getPlayerData(event.getPlayer()); if(!event.getTo().equals(data.movingSetBackPoint) && !event.getTo().equals(data.speedhackSetBackPoint)) { data.speedhackSetBackPoint = null;