Changed the color of party leader names in Party chat

This commit is contained in:
TfT_02 2013-08-17 13:53:46 +02:00
parent 1f712063bf
commit fe93be66ad
4 changed files with 11 additions and 1 deletions

View File

@ -24,6 +24,7 @@ Version 1.4.07-dev
= Fixed a bug where the Dodge DamageModifier wasn't being read from advanced.yml = Fixed a bug where the Dodge DamageModifier wasn't being read from advanced.yml
! Changed the way Repair hands out XP, also added config options to control Repair XP ! Changed the way Repair hands out XP, also added config options to control Repair XP
! Admin and Party chat prefixes are now customizable ! Admin and Party chat prefixes are now customizable
! Changed the color of party leader names in Party chat
! Improved profile saving ! Improved profile saving
! Updated localization files ! Updated localization files
! Party item share category states are now saved when the server shuts down. ! Party item share category states are now saved when the server shuts down.

View File

@ -11,6 +11,7 @@ public abstract class ChatManager {
protected boolean useDisplayNames; protected boolean useDisplayNames;
protected String chatPrefix; protected String chatPrefix;
protected String senderName;
protected String displayName; protected String displayName;
protected String message; protected String message;
@ -27,7 +28,8 @@ public abstract class ChatManager {
return; return;
} }
displayName = useDisplayNames ? event.getDisplayName() : event.getSender(); senderName = event.getSender();
displayName = useDisplayNames ? event.getDisplayName() : senderName;
message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage(); message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage();
sendMessage(); sendMessage();

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.chat; package com.gmail.nossr50.chat;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@ -25,6 +26,10 @@ public class PartyChatManager extends ChatManager {
@Override @Override
protected void sendMessage() { protected void sendMessage() {
if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader())) {
message = message.replaceAll(displayName, ChatColor.GOLD + displayName + ChatColor.RESET);
}
for (Player member : party.getOnlineMembers()) { for (Player member : party.getOnlineMembers()) {
member.sendMessage(message); member.sendMessage(message);
} }

View File

@ -226,7 +226,9 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); } public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
public String getPartyChatPrefix() { return config.getString("Commands.p.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); } public String getPartyChatPrefix() { return config.getString("Commands.p.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.p.Gold_Leader_Name", true); }
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); } public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); }
public String getAdminChatPrefix() { return config.getString("Commands.a.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); } public String getAdminChatPrefix() { return config.getString("Commands.a.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); } public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }