diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-07-13 17:24:40 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-07-13 17:25:58 +0100 |
commit | 4934cac1c6510ecb7aca4f6adc70356f7a78c10f (patch) | |
tree | ec16737346196ffe7846b60f3abca9be707b6de2 /EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java | |
parent | 7f0c3ac44a3c93c6909d09e1862b6b8d0b951951 (diff) | |
download | Essentials-4934cac1c6510ecb7aca4f6adc70356f7a78c10f.tar Essentials-4934cac1c6510ecb7aca4f6adc70356f7a78c10f.tar.gz Essentials-4934cac1c6510ecb7aca4f6adc70356f7a78c10f.tar.lz Essentials-4934cac1c6510ecb7aca4f6adc70356f7a78c10f.tar.xz Essentials-4934cac1c6510ecb7aca4f6adc70356f7a78c10f.zip |
Remove old chat hook
Use Bukkit API for local chat handling
Implement localChatSpy event
Diffstat (limited to 'EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java | 18 |
1 files changed, 9 insertions, 9 deletions
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<String, IEssentialsChatListener> listeners, final Map<AsyncPlayerChatEvent, ChatStore> 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); } } |