From 4934cac1c6510ecb7aca4f6adc70356f7a78c10f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 13 Jul 2013 17:24:40 +0100 Subject: Remove old chat hook Use Bukkit API for local chat handling Implement localChatSpy event --- .../chat/EssentialsChatPlayerListenerLowest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java') diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 7eaaf2e0f..51472163f 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -19,10 +19,9 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer { public EssentialsChatPlayerListenerLowest(final Server server, final IEssentials ess, - final Map listeners, final Map chatStorage) { - super(server, ess, listeners, chatStorage); + super(server, ess, chatStorage); } @EventHandler(priority = EventPriority.LOWEST) @@ -36,11 +35,12 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer final User user = ess.getUser(event.getPlayer()); - if (user == null) { + if (user == null) + { event.setCancelled(true); return; } - + final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); setChatStore(event, chatStore); @@ -51,16 +51,16 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer String group = user.getGroup(); String world = user.getWorld().getName(); Team team = user.getScoreboard().getPlayerTeam(user.getBase()); - + String format = ess.getSettings().getChatFormat(group); format = format.replace("{0}", group); format = format.replace("{1}", world); format = format.replace("{2}", world.substring(0, 1).toUpperCase(Locale.ENGLISH)); - format = format.replace("{3}", team == null ? "" : team.getPrefix()); - format = format.replace("{4}", team == null ? "" : team.getSuffix()); - format = format.replace("{5}", team == null ? "" : team.getDisplayName()); + format = format.replace("{3}", team == null ? "" : team.getPrefix()); + format = format.replace("{4}", team == null ? "" : team.getSuffix()); + format = format.replace("{5}", team == null ? "" : team.getDisplayName()); synchronized (format) - { + { event.setFormat(format); } } -- cgit v1.2.3