mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-07 00:08:20 +01:00
Fixed not working cancelling of move events.
This commit is contained in:
parent
b68111da6c
commit
c902b5d249
@ -192,6 +192,10 @@ public class MovingCheckListener implements Listener, EventManager {
|
|||||||
if(event.isCancelled() || event.getPlayer().isInsideVehicle() || event.getPlayer().isDead())
|
if(event.isCancelled() || event.getPlayer().isInsideVehicle() || event.getPlayer().isDead())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(!event.getFrom().getWorld().equals(event.getTo().getWorld()) || event.getFrom().distanceSquared(event.getTo()) > 400) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final NoCheatPlayer player = plugin.getPlayer(event.getPlayer());
|
final NoCheatPlayer player = plugin.getPlayer(event.getPlayer());
|
||||||
|
|
||||||
final MovingConfig cc = MovingCheck.getConfig(player.getConfigurationStore());
|
final MovingConfig cc = MovingCheck.getConfig(player.getConfigurationStore());
|
||||||
@ -207,6 +211,9 @@ public class MovingCheckListener implements Listener, EventManager {
|
|||||||
final Location to = event.getTo();
|
final Location to = event.getTo();
|
||||||
data.to.set(to);
|
data.to.set(to);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PreciseLocation newTo = null;
|
PreciseLocation newTo = null;
|
||||||
|
|
||||||
/** RUNFLY CHECK SECTION **/
|
/** RUNFLY CHECK SECTION **/
|
||||||
@ -226,7 +233,7 @@ public class MovingCheckListener implements Listener, EventManager {
|
|||||||
/** MOREPACKETS CHECK SECTION **/
|
/** MOREPACKETS CHECK SECTION **/
|
||||||
if(!cc.morePacketsCheck || player.hasPermission(Permissions.MOVING_MOREPACKETS)) {
|
if(!cc.morePacketsCheck || player.hasPermission(Permissions.MOVING_MOREPACKETS)) {
|
||||||
data.clearMorePacketsData();
|
data.clearMorePacketsData();
|
||||||
} else if(newTo != null) {
|
} else if(newTo == null) {
|
||||||
newTo = morePacketsCheck.check(player, data, cc);
|
newTo = morePacketsCheck.check(player, data, cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user