forked from GeyserMC/Geyser
Merge pull request #330 from rtm516/colour-style-formatting-fix
Fixed colour and style formatting for some messages
This commit is contained in:
commit
9e634d2f14
1 changed files with 8 additions and 4 deletions
|
@ -58,7 +58,7 @@ public class MessageUtils {
|
||||||
strings.add(" - no permission or invalid command!");
|
strings.add(" - no permission or invalid command!");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> furtherParams = getTranslationParams(translation.getTranslationParams());
|
List<String> furtherParams = getTranslationParams(translation.getTranslationParams(), locale);
|
||||||
if (locale != null) {
|
if (locale != null) {
|
||||||
strings.add(insertParams(LocaleUtils.getLocaleString(translation.getTranslationKey(), locale), furtherParams));
|
strings.add(insertParams(LocaleUtils.getLocaleString(translation.getTranslationKey(), locale), furtherParams));
|
||||||
}else{
|
}else{
|
||||||
|
@ -96,7 +96,11 @@ public class MessageUtils {
|
||||||
messageText = LocaleUtils.getLocaleString(messageText, locale);
|
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()) {
|
for (Message msg : message.getExtra()) {
|
||||||
builder.append(getFormat(msg.getStyle().getFormats()));
|
builder.append(getFormat(msg.getStyle().getFormats()));
|
||||||
builder.append(getColorOrParent(msg.getStyle()));
|
builder.append(getColorOrParent(msg.getStyle()));
|
||||||
|
@ -139,8 +143,8 @@ public class MessageUtils {
|
||||||
private static String getColorOrParent(MessageStyle style) {
|
private static String getColorOrParent(MessageStyle style) {
|
||||||
ChatColor chatColor = style.getColor();
|
ChatColor chatColor = style.getColor();
|
||||||
|
|
||||||
if (chatColor == ChatColor.NONE) {
|
if (chatColor == ChatColor.NONE && style.getParent() != null) {
|
||||||
return getColor(style.getParent().getColor());
|
return getColorOrParent(style.getParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
return getColor(chatColor);
|
return getColor(chatColor);
|
||||||
|
|
Loading…
Reference in a new issue