From 614aa9d5e5dafc071a297b047caf826d91eab563 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 23 Nov 2015 20:59:13 +0100 Subject: [PATCH] Fix noTeleport in the PlayerListener --- .../authme/listener/AuthMePlayerListener.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index 9f17421fd..3543acbff 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -166,24 +166,25 @@ public class AuthMePlayerListener implements Listener { public void onPlayerMove(PlayerMoveEvent event) { int radius = Settings.getMovementRadius; boolean allowMove = Settings.isMovementAllowed; - if (allowMove && radius <= 0) + if (Settings.noTeleport) { return; + } + if (allowMove && radius <= 0) { + return; + } Player player = event.getPlayer(); - if (Utils.checkAuth(player)) + if (Utils.checkAuth(player)) { return; + } if (!allowMove) { if (event.getFrom().distance(event.getTo()) > 0) { - event.setTo(event.getFrom()); + event.setCancelled(true); return; } } - if (radius <= 0) { - return; - } - Location spawn = plugin.getSpawnLocation(player); if (spawn != null && spawn.getWorld() != null) { if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {