diff options
author | ementalo <me@ementalo.com> | 2015-04-11 21:47:56 +0100 |
---|---|---|
committer | ementalo <me@ementalo.com> | 2015-04-11 21:47:56 +0100 |
commit | 9e6c686c297eb233dfa19872f2f42bbd2a8f421f (patch) | |
tree | bc1dfa4e3ec7ca5ce8c459baaaebe4bd2b09ec5e /EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java | |
parent | ce8313bd688ecad3ed98decaf5ef9029fca8f100 (diff) | |
download | Essentials-9e6c686c297eb233dfa19872f2f42bbd2a8f421f.tar Essentials-9e6c686c297eb233dfa19872f2f42bbd2a8f421f.tar.gz Essentials-9e6c686c297eb233dfa19872f2f42bbd2a8f421f.tar.lz Essentials-9e6c686c297eb233dfa19872f2f42bbd2a8f421f.tar.xz Essentials-9e6c686c297eb233dfa19872f2f42bbd2a8f421f.zip |
Change namespace from com.earth2me to org.mcess - net.ess3.api changes still required
Diffstat (limited to 'EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java deleted file mode 100644 index aa40a8148..000000000 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.earth2me.essentials.chat; - -import com.earth2me.essentials.User; -import com.earth2me.essentials.utils.FormatUtil; -import net.ess3.api.IEssentials; -import java.util.Locale; -import java.util.Map; -import org.bukkit.Server; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.scoreboard.Team; - - -public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer -{ - public EssentialsChatPlayerListenerLowest(final Server server, - final IEssentials ess, - final Map<AsyncPlayerChatEvent, ChatStore> chatStorage) - { - super(server, ess, chatStorage); - } - - @EventHandler(priority = EventPriority.LOWEST) - @Override - public void onPlayerChat(final AsyncPlayerChatEvent event) - { - if (isAborted(event)) - { - return; - } - - final User user = ess.getUser(event.getPlayer()); - - if (user == null) - { - event.setCancelled(true); - return; - } - - final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); - setChatStore(event, chatStore); - - /** - * This listener should apply the general chat formatting only...then return control back the event handler - */ - event.setMessage(FormatUtil.formatMessage(user, "essentials.chat", event.getMessage())); - String group = user.getGroup(); - String world = user.getWorld().getName(); - Team team = user.getBase().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()); - synchronized (format) - { - event.setFormat(format); - } - } -} |