diff --git a/patches/server/0011-Adventure.patch b/patches/server/0011-Adventure.patch index bfb77e1223..b103d717d3 100644 --- a/patches/server/0011-Adventure.patch +++ b/patches/server/0011-Adventure.patch @@ -498,10 +498,10 @@ index 0000000000000000000000000000000000000000..eeedc30a45d9637d68f04f185b3dd90d +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java new file mode 100644 -index 0000000000000000000000000000000000000000..f63b80a1120b2bf5f77f1c1edb928309a1272f79 +index 0000000000000000000000000000000000000000..41762b5ed19b17ee524f79726eaa4cf38479ba96 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -@@ -0,0 +1,370 @@ +@@ -0,0 +1,375 @@ +package io.papermc.paper.adventure; + +import com.mojang.brigadier.exceptions.CommandSyntaxException; @@ -527,6 +527,7 @@ index 0000000000000000000000000000000000000000..f63b80a1120b2bf5f77f1c1edb928309 +import net.kyori.adventure.translation.GlobalTranslator; +import net.kyori.adventure.util.Codec; +import net.minecraft.ChatFormatting; ++import net.minecraft.locale.Language; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; @@ -545,7 +546,11 @@ index 0000000000000000000000000000000000000000..f63b80a1120b2bf5f77f1c1edb928309 + private static final Pattern LOCALIZATION_PATTERN = Pattern.compile("%(?:(\\d+)\\$)?s"); + public static final ComponentFlattener FLATTENER = ComponentFlattener.basic().toBuilder() + .complexMapper(TranslatableComponent.class, (translatable, consumer) -> { -+ final @NonNull String translated = net.minecraft.locale.Language.getInstance().getOrDefault(translatable.key()); ++ if (!Language.getInstance().has(translatable.key())) { ++ consumer.accept(GlobalTranslator.render(translatable, Locale.US)); ++ return; ++ } ++ final @NonNull String translated = Language.getInstance().getOrDefault(translatable.key()); + + final Matcher matcher = LOCALIZATION_PATTERN.matcher(translated); + final List args = translatable.args();