Skip to content

Commit

Permalink
Fix chat translation parameters not having color sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Aug 11, 2020
1 parent 31fec1d commit 016a5c0
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ public static List<String> getTranslationParams(List<Message> messages, String l
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<String> furtherParams = new ArrayList<>();
for (String param : getTranslationParams(translation.getWith(), locale, message)) {
Expand All @@ -133,9 +125,16 @@ public static List<String> getTranslationParams(List<Message> messages, String l
}

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()) +
Expand Down

0 comments on commit 016a5c0

Please sign in to comment.