3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Fixed colour and style formatting for some messages

Dieser Commit ist enthalten in:
rtm516 2020-04-13 22:29:22 +01:00
Ursprung e67ed6dc8d
Commit 3616aa07fe

Datei anzeigen

@ -58,7 +58,7 @@ public class MessageUtils {
strings.add(" - no permission or invalid command!");
}
List<String> furtherParams = getTranslationParams(translation.getTranslationParams());
List<String> furtherParams = getTranslationParams(translation.getTranslationParams(), locale);
if (locale != null) {
strings.add(insertParams(LocaleUtils.getLocaleString(translation.getTranslationKey(), locale), furtherParams));
}else{
@ -96,7 +96,11 @@ public class MessageUtils {
messageText = LocaleUtils.getLocaleString(messageText, locale);
}
StringBuilder builder = new StringBuilder(messageText);
StringBuilder builder = new StringBuilder();
builder.append(getFormat(message.getStyle().getFormats()));
builder.append(getColorOrParent(message.getStyle()));
builder.append(messageText);
for (Message msg : message.getExtra()) {
builder.append(getFormat(msg.getStyle().getFormats()));
builder.append(getColorOrParent(msg.getStyle()));
@ -139,8 +143,8 @@ public class MessageUtils {
private static String getColorOrParent(MessageStyle style) {
ChatColor chatColor = style.getColor();
if (chatColor == ChatColor.NONE) {
return getColor(style.getParent().getColor());
if (chatColor == ChatColor.NONE && style.getParent() != null) {
return getColorOrParent(style.getParent());
}
return getColor(chatColor);