summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-06-28 17:12:01 +0100
committerKHobbits <rob@khobbits.co.uk>2013-06-28 17:12:01 +0100
commitdfcbdb7bb158cd2eba6b41f36df2f5419c616bba (patch)
tree5630f8479b2a9218ba932221b02c785020937e8a /EssentialsChat/src
parent9e11a4a381fd0a145a865ebf4b2a04afe4dc6825 (diff)
downloadEssentials-dfcbdb7bb158cd2eba6b41f36df2f5419c616bba.tar
Essentials-dfcbdb7bb158cd2eba6b41f36df2f5419c616bba.tar.gz
Essentials-dfcbdb7bb158cd2eba6b41f36df2f5419c616bba.tar.lz
Essentials-dfcbdb7bb158cd2eba6b41f36df2f5419c616bba.tar.xz
Essentials-dfcbdb7bb158cd2eba6b41f36df2f5419c616bba.zip
Add {TEAMPREFIX} {TEAMSUFFIX} and {TEAMNAME} to chat formatting.
Diffstat (limited to 'EssentialsChat/src')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
index efd3f5515..156a570f8 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
@@ -11,6 +11,8 @@ import org.bukkit.Server;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent;
+import org.bukkit.scoreboard.Scoreboard;
+import org.bukkit.scoreboard.Team;
public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
@@ -48,10 +50,15 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
event.setMessage(FormatUtil.formatMessage(user, "essentials.chat", event.getMessage()));
String group = user.getGroup();
String world = user.getWorld().getName();
+ Team team = user.getScoreboard().getPlayerTeam(user);
+
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);