From 89eca7d99158e59e9a6807492bdf219dc25c31a6 Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 18 Jun 2012 13:55:25 +0100 Subject: 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. --- .../chat/EssentialsLocalChatEventListener.java | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'EssentialsChat/src/com/earth2me') 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 +} -- cgit v1.2.3