diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/TranslationUtil.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/TranslationUtil.java index 06cd0cbe..0acb8a39 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/TranslationUtil.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/TranslationUtil.java @@ -10,14 +10,15 @@ public class TranslationUtil { // unlocked-cosmetic -> true -> True - private static HashMap> keys = new HashMap<>(); + private static final HashMap> keys = new HashMap<>(); public static void setup(ConfigurationNode config) { + keys.clear(); for (ConfigurationNode node : config.childrenMap().values()) { ArrayList pairs = new ArrayList<>(); for (ConfigurationNode translatableMessage : node.childrenMap().values()) { String key = translatableMessage.key().toString(); - key.replaceAll("'", ""); // Autoupdater adds ' to it? Removes it from the key + key = key.replaceAll("'", ""); // Autoupdater adds ' to it? Removes it from the key TranslationPair pair = new TranslationPair(key, translatableMessage.getString()); pairs.add(pair); MessagesUtil.sendDebugMessages("setupTranslation key:" + node.key().toString() + " | " + node); @@ -31,7 +32,7 @@ public static void setup(ConfigurationNode config) { public static String getTranslation(String key, String message) { List pairs = keys.get(key); for (TranslationPair pair : pairs) { - if (pair.key() == message) return StringUtils.parseStringToString(pair.value()); + if (pair.key().equals(message)) return StringUtils.parseStringToString(pair.value()); } return message;