diff options
author | ementalo <ementalodev@gmx.co.uk> | 2012-06-18 13:55:25 +0100 |
---|---|---|
committer | ementalo <ementalodev@gmx.co.uk> | 2012-06-18 13:55:25 +0100 |
commit | 89eca7d99158e59e9a6807492bdf219dc25c31a6 (patch) | |
tree | 9100782dcfdb97087b3a871320ce03e665250224 /EssentialsChat | |
parent | 88e7e684afbc67ad7b6410e5429c2760cd93b542 (diff) | |
download | Essentials-89eca7d99158e59e9a6807492bdf219dc25c31a6.tar Essentials-89eca7d99158e59e9a6807492bdf219dc25c31a6.tar.gz Essentials-89eca7d99158e59e9a6807492bdf219dc25c31a6.tar.lz Essentials-89eca7d99158e59e9a6807492bdf219dc25c31a6.tar.xz Essentials-89eca7d99158e59e9a6807492bdf219dc25c31a6.zip |
2.9 Merges
Make /vanish follow the same rules as /fly, /god and /gamemode
Add espawn to plugin.yml
Allow your hat to be removed with /hat remove
void silent command failures on /hat (ie typing /hat fish will no longer silently return as if broken)
Fix /exp so it can be used in the console
Using /exp, show can't find player message, if no matching player is found
Replace op ignore exempt with ignore exempt chat permission:
essentials.chat.ignoreexempt
This permission won't prevent a player from ignoring the player, but the player will see the chat messages anyway.
Fix chat showing [spy] prefix when social spy was not required to see the message
Players should not be able to ignore Console
Also implement chat exempt permission in other commands.
Prevent joinbots from triggering join code, unless they are actually connected to the server and online.
Diffstat (limited to 'EssentialsChat')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java index 8788d755d..04c49b698 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java @@ -37,36 +37,35 @@ public class EssentialsLocalChatEventListener implements Listener { String type = _("chatTypeLocal"); final IUser user = ess.getUser(onlinePlayer); - //TODO: remove reference to op - if (user.isIgnoringPlayer(sender.getName()) && !sender.isOp()) + if (user.isIgnoringPlayer(ess.getUser(sender))) { continue; } if (!user.equals(sender)) { - if (Permissions.CHAT_SPY.isAuthorized(user)) + boolean abort = false; + final Location playerLoc = user.getLocation(); + if (playerLoc.getWorld() != world) { - type = type.concat(_("chatTypeSpy")); + abort = true; } - else + final double delta = playerLoc.distanceSquared(loc); + + if (delta > event.getRadius()) { - final Location playerLoc = user.getLocation(); - if (playerLoc.getWorld() != world) - { - continue; - } - final double delta = playerLoc.distanceSquared(loc); + abort = true; + } - if (delta > event.getRadius()) + if (abort) + { + if (ChatPermissions.getPermission("spy").isAuthorized(user)) { - continue; + type = type.concat(_("chatTypeSpy")); } } - - 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 +} |