From 016a5c04ea57decfcaaaccfd08f7e7cfdbdd9995 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Tue, 11 Aug 2020 18:45:14 +0100 Subject: [PATCH] Fix chat translation parameters not having color sometimes --- .../connector/utils/MessageUtils.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/utils/MessageUtils.java b/connector/src/main/java/org/geysermc/connector/utils/MessageUtils.java index 36cdbc422..a127fd8db 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/MessageUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/MessageUtils.java @@ -110,14 +110,6 @@ public class MessageUtils { 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 List furtherParams = new ArrayList<>(); for (String param : getTranslationParams(translation.getWith(), locale, message)) { @@ -133,9 +125,16 @@ public class MessageUtils { } 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 { - strings.addAll(furtherParams); + String format = getFormat(message.getStyle().getFormats()) + + getColor(message.getStyle().getColor()); + for (String param : furtherParams) { + strings.add(format + param); + } } } else { String builder = getFormat(message.getStyle().getFormats()) +