mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
@ -7,7 +7,7 @@ import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||
|
||||
public class AdminChatManager extends ChatManager {
|
||||
protected AdminChatManager(Plugin plugin) {
|
||||
super(plugin, Config.getInstance().getAdminDisplayNames(), "Commands.AdminChat.Prefix");
|
||||
super(plugin, Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@ public abstract class ChatManager {
|
||||
}
|
||||
|
||||
displayName = useDisplayNames ? event.getDisplayName() : event.getSender();
|
||||
message = LocaleLoader.getString(chatPrefix, displayName) + event.getMessage();
|
||||
message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage();
|
||||
|
||||
sendMessage();
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ public class PartyChatManager extends ChatManager {
|
||||
private Party party;
|
||||
|
||||
protected PartyChatManager(Plugin plugin) {
|
||||
super(plugin, Config.getInstance().getPartyDisplayNames(), "Commands.Party.Chat.Prefix");
|
||||
super(plugin, Config.getInstance().getPartyDisplayNames(), Config.getInstance().getPartyChatPrefix());
|
||||
}
|
||||
|
||||
public void setParty(Party party) {
|
||||
|
@ -225,7 +225,9 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
||||
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 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 boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
||||
|
||||
/* Mob Healthbar */
|
||||
|
@ -46,17 +46,19 @@ public final class LocaleLoader {
|
||||
}
|
||||
|
||||
private static String getString(String key, ResourceBundle bundle, Object... messageArguments) throws MissingResourceException {
|
||||
String output = bundle.getString(key);
|
||||
return formatString(bundle.getString(key), messageArguments);
|
||||
}
|
||||
|
||||
public static String formatString(String string, Object... messageArguments) {
|
||||
if (messageArguments != null) {
|
||||
MessageFormat formatter = new MessageFormat("");
|
||||
formatter.applyPattern(output);
|
||||
output = formatter.format(messageArguments);
|
||||
formatter.applyPattern(string);
|
||||
string = formatter.format(messageArguments);
|
||||
}
|
||||
|
||||
output = addColors(output);
|
||||
string = addColors(string);
|
||||
|
||||
return output;
|
||||
return string;
|
||||
}
|
||||
|
||||
public static Locale getCurrentLocale() {
|
||||
|
Reference in New Issue
Block a user