diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java index b7e6838e4..9d2e694b6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java @@ -32,7 +32,6 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.renderer.TranslatableComponentRenderer; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import net.kyori.adventure.translation.TranslationRegistry; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.utils.LanguageUtils; @@ -41,8 +40,7 @@ import java.util.*; public class MessageTranslator { // These are used for handling the translations of the messages - private static final TranslationRegistry REGISTRY = new MinecraftTranslationRegistry(); - private static final TranslatableComponentRenderer RENDERER = TranslatableComponentRenderer.usingTranslationSource(REGISTRY); + private static final TranslatableComponentRenderer RENDERER = TranslatableComponentRenderer.usingTranslationSource(new MinecraftTranslationRegistry()); // Store team colors for player names private static final Map TEAM_COLORS = new HashMap<>(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MinecraftTranslationRegistry.java b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MinecraftTranslationRegistry.java index 127e00603..78fd8fec7 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MinecraftTranslationRegistry.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MinecraftTranslationRegistry.java @@ -26,7 +26,7 @@ package org.geysermc.connector.network.translators.chat; import net.kyori.adventure.key.Key; -import net.kyori.adventure.translation.TranslationRegistry; +import net.kyori.adventure.translation.Translator; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.geysermc.connector.utils.LocaleUtils; @@ -40,10 +40,10 @@ import java.util.regex.Pattern; * This class is used for mapping a translation key with the already loaded Java locale data * Used in MessageTranslator.java as part of the KyoriPowered/Adventure library */ -public class MinecraftTranslationRegistry implements TranslationRegistry { +public class MinecraftTranslationRegistry implements Translator { @Override public @NonNull Key name() { - return Key.key("", ""); + return Key.key("geyser", "minecraft_translations"); } @Override @@ -73,19 +73,4 @@ public class MinecraftTranslationRegistry implements TranslationRegistry { return new MessageFormat(sb.toString(), locale); } - - @Override - public void defaultLocale(@NonNull Locale locale) { - - } - - @Override - public void register(@NonNull String key, @NonNull Locale locale, @NonNull MessageFormat format) { - - } - - @Override - public void unregister(@NonNull String key) { - - } }