diff options
Diffstat (limited to 'EssentialsChat/src/com/earth2me/essentials')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index 8037234fd..6a86de1f1 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -142,6 +142,26 @@ 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)); |