diff options
author | ementalo <ementalodev@gmx.co.uk> | 2012-06-06 01:53:34 +0100 |
---|---|---|
committer | ementalo <ementalodev@gmx.co.uk> | 2012-06-06 01:53:34 +0100 |
commit | ff5a82a14cbffbbd65e9baefb09d2c95305124c1 (patch) | |
tree | 85876a5615a9b2e630b0673bdb1a85ecffb54f0d /EssentialsChat/src/com/earth2me | |
parent | 9b7a40736e54c6a692d3f5ceda72d11b638e728f (diff) | |
download | Essentials-ff5a82a14cbffbbd65e9baefb09d2c95305124c1.tar Essentials-ff5a82a14cbffbbd65e9baefb09d2c95305124c1.tar.gz Essentials-ff5a82a14cbffbbd65e9baefb09d2c95305124c1.tar.lz Essentials-ff5a82a14cbffbbd65e9baefb09d2c95305124c1.tar.xz Essentials-ff5a82a14cbffbbd65e9baefb09d2c95305124c1.zip |
2.9 -> 3.0 merge
Diffstat (limited to 'EssentialsChat/src/com/earth2me')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java | 21 | ||||
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java | 25 |
2 files changed, 14 insertions, 32 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index acf08a5dd..7618a66ab 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -112,6 +112,7 @@ public abstract class EssentialsChatPlayer implements Listener protected void handleLocalChat(final PlayerChatEvent event, final ChatStore chatStore) { + long radius = 0; ISettings settings = ess.getSettings(); settings.acquireReadLock(); @@ -143,26 +144,6 @@ public abstract class EssentialsChatPlayer implements Listener event.setFormat(_(format.toString(), event.getFormat())); return; } - if (!onlineUser.equals(sender)) - { - if (onlineUser.isAuthorized("essentials.chat.spy")) - { - type = type.concat(_("chatTypeSpy")); - } - else - { - final Location playerLoc = onlineUser.getLocation(); - if (playerLoc.getWorld() != world) - { - continue; - } - final double delta = playerLoc.distanceSquared(loc); - if (delta > chatStore.getRadius()) - { - continue; - } - } - } final StringBuilder errorMsg = new StringBuilder(); errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1)); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java index 401fa1142..8788d755d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java @@ -44,28 +44,29 @@ public class EssentialsLocalChatEventListener implements Listener } if (!user.equals(sender)) { - final Location playerLoc = user.getLocation(); - if (playerLoc.getWorld() != world) + if (Permissions.CHAT_SPY.isAuthorized(user)) { - continue; + type = type.concat(_("chatTypeSpy")); } - final double delta = playerLoc.distanceSquared(loc); - - if (delta > event.getRadius()) + else { - if (Permissions.CHAT_SPY.isAuthorized(user)) + final Location playerLoc = user.getLocation(); + if (playerLoc.getWorld() != world) { - type = type.concat(_("chatTypeSpy")); + continue; } - else + final double delta = playerLoc.distanceSquared(loc); + + if (delta > event.getRadius()) { continue; } } - } - final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage())); - user.sendMessage(message); + final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage())); + user.sendMessage(message); + } } + } }
\ No newline at end of file |