mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 03:02:11 +01:00
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:
parent
da413e842f
commit
b821292bf2
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user