mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-29 12:14:43 +02:00
Full hex color support in admin/party chat
This commit is contained in:
@ -54,7 +54,7 @@ public class AdminChatMailer extends AbstractChatMailer {
|
||||
*/
|
||||
public @NotNull TextComponent addStyle(@NotNull Author author, @NotNull String message, boolean canColor) {
|
||||
if(canColor) {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Admin", author.getAuthoredName(ChatChannel.ADMIN), LocaleLoader.addColors(message)));
|
||||
return LocaleLoader.getTextComponent("Chat.Style.Admin", TextUtils.sanitizeAuthorName(author, ChatChannel.ADMIN), message);
|
||||
} else {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Admin", author.getAuthoredName(ChatChannel.ADMIN), message));
|
||||
}
|
||||
@ -75,4 +75,6 @@ public class AdminChatMailer extends AbstractChatMailer {
|
||||
sendMail(chatMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -46,13 +46,17 @@ public class PartyChatMailer extends AbstractChatMailer {
|
||||
*/
|
||||
public @NotNull TextComponent addStyle(@NotNull Author author, @NotNull String message, boolean canColor, boolean isLeader) {
|
||||
if(canColor) {
|
||||
message = LocaleLoader.addColors(message);
|
||||
}
|
||||
|
||||
if(isLeader) {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party.Leader", author.getAuthoredName(ChatChannel.PARTY), message));
|
||||
if(isLeader) {
|
||||
return LocaleLoader.getTextComponent("Chat.Style.Party.Leader", TextUtils.sanitizeAuthorName(author, ChatChannel.PARTY), message);
|
||||
} else {
|
||||
return LocaleLoader.getTextComponent("Chat.Style.Party", author.getAuthoredName(ChatChannel.PARTY), message);
|
||||
}
|
||||
} else {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party", author.getAuthoredName(ChatChannel.PARTY), message));
|
||||
if(isLeader) {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party.Leader", author.getAuthoredName(ChatChannel.PARTY), message));
|
||||
} else {
|
||||
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party", author.getAuthoredName(ChatChannel.PARTY), message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class PartyChatMessage extends AbstractChatMessage {
|
||||
|
||||
//Sends to everyone but console
|
||||
audience.sendMessage(author, componentMessage);
|
||||
TextComponent spyMessage = TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Spy.Party", author.getAuthoredName(ChatChannel.PARTY), rawMessage, party.getName()));
|
||||
TextComponent spyMessage = LocaleLoader.getTextComponent("Chat.Spy.Party", TextUtils.sanitizeAuthorName(author, ChatChannel.PARTY), rawMessage, party.getName());
|
||||
|
||||
//Relay to spies
|
||||
messagePartyChatSpies(spyMessage);
|
||||
|
Reference in New Issue
Block a user