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.
This commit is contained in:
Evenprime 2011-03-13 15:57:19 +01:00
parent da413e842f
commit b821292bf2
4 changed files with 7 additions and 7 deletions

View File

@ -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();

View File

@ -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);
}
}

View File

@ -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());
}
}

View File

@ -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;