From d7f9b602c761f608f4a3cb81e4e2882de39cf4f0 Mon Sep 17 00:00:00 2001 From: DNx5 Date: Sat, 21 Nov 2015 19:56:03 +0700 Subject: [PATCH] update some Utils method --- .../xephi/authme/listener/AuthMePlayerListener.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index aa0e24a67..6d8c68f50 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -162,8 +162,11 @@ public class AuthMePlayerListener implements Listener { * * @param event PlayerMoveEvent */ - @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.MONITOR) public void onPlayerMove(PlayerMoveEvent event) { + if (event.isCancelled()) + return; + int radius = Settings.getMovementRadius; boolean allowMove = Settings.isMovementAllowed; if (Settings.noTeleport) { @@ -187,12 +190,12 @@ public class AuthMePlayerListener implements Listener { Location spawn = plugin.getSpawnLocation(player); if (spawn != null && spawn.getWorld() != null) { - if (!event.getPlayer().getWorld().equals(spawn.getWorld())) { - event.getPlayer().teleport(spawn); + if (!player.getWorld().equals(spawn.getWorld())) { + player.teleport(spawn); return; } if ((spawn.distance(player.getLocation()) > radius)) { - event.getPlayer().teleport(spawn); + player.teleport(spawn); } } }