forked from GeyserMC/Geyser
Fix chat translation parameters not having color sometimes
This commit is contained in:
parent
31fec1d4bf
commit
016a5c04ea
1 changed files with 9 additions and 10 deletions
|
@ -110,14 +110,6 @@ public class MessageUtils {
|
||||||
strings.add(builder);
|
strings.add(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (translation.getKey().equals("commands.gamemode.success.other")) {
|
|
||||||
strings.add("");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (translation.getKey().equals("command.context.here")) {
|
|
||||||
strings.add(" - no permission or invalid command!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect all params and add format corrections to the end of them
|
// Collect all params and add format corrections to the end of them
|
||||||
List<String> furtherParams = new ArrayList<>();
|
List<String> furtherParams = new ArrayList<>();
|
||||||
for (String param : getTranslationParams(translation.getWith(), locale, message)) {
|
for (String param : getTranslationParams(translation.getWith(), locale, message)) {
|
||||||
|
@ -133,9 +125,16 @@ public class MessageUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locale != null) {
|
if (locale != null) {
|
||||||
strings.add(insertParams(LocaleUtils.getLocaleString(translation.getKey(), locale), furtherParams));
|
String builder = getFormat(message.getStyle().getFormats()) +
|
||||||
|
getColor(message.getStyle().getColor());
|
||||||
|
builder += insertParams(LocaleUtils.getLocaleString(translation.getKey(), locale), furtherParams);
|
||||||
|
strings.add(builder);
|
||||||
} else {
|
} else {
|
||||||
strings.addAll(furtherParams);
|
String format = getFormat(message.getStyle().getFormats()) +
|
||||||
|
getColor(message.getStyle().getColor());
|
||||||
|
for (String param : furtherParams) {
|
||||||
|
strings.add(format + param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String builder = getFormat(message.getStyle().getFormats()) +
|
String builder = getFormat(message.getStyle().getFormats()) +
|
||||||
|
|
Loading…
Reference in a new issue