From e80c098e3df25b41a41d5c5ee0e35085a450d821 Mon Sep 17 00:00:00 2001 From: DNx5 Date: Fri, 27 Nov 2015 00:14:29 +0700 Subject: [PATCH] Fix unauthenticated recipients removed even chat is allowed. --- .../xephi/authme/listener/AuthMePlayerListener.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index 43044ac8a..01222ae6d 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -57,6 +57,10 @@ public class AuthMePlayerListener implements Listener { * @param event AsyncPlayerChatEvent */ private void handleChat(AsyncPlayerChatEvent event) { + if (Settings.isChatAllowed || Utils.checkAuth(event.getPlayer())) { + return; + } + Player player = event.getPlayer(); for (Player p : Utils.getOnlinePlayers()) { if (!PlayerCache.getInstance().isAuthenticated(p.getName())) { @@ -64,14 +68,6 @@ public class AuthMePlayerListener implements Listener { } } - if (Settings.isChatAllowed) { - return; - } - - if (Utils.checkAuth(player)) { - return; - } - event.setCancelled(true); if (plugin.database.isAuthAvailable(player.getName().toLowerCase())) { m.send(player, MessageKey.LOGIN_MESSAGE);