diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 239ffe15ad..40c5340aba 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2599,8 +2599,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - buf.writeUtf(Component.Serializer.toJson(this.reason, RegistryAccess.EMPTY)); + // Paper start - Adventure + // buf.writeUtf(Component.Serializer.toJson(this.reason, RegistryAccess.EMPTY)); -+ // In the login phase, buf.adventure$locale field is always null -+ buf.writeJsonWithCodec(net.minecraft.network.chat.ComponentSerialization.localizedCodec(java.util.Locale.US), this.reason, FriendlyByteBuf.MAX_COMPONENT_STRING_LENGTH); ++ // In the login phase, buf.adventure$locale field is most likely null, but plugins may use internals to set it via the channel attribute ++ java.util.Locale bufLocale = buf.adventure$locale; ++ buf.writeJsonWithCodec(net.minecraft.network.chat.ComponentSerialization.localizedCodec(bufLocale == null ? java.util.Locale.US : bufLocale), this.reason, FriendlyByteBuf.MAX_COMPONENT_STRING_LENGTH); + // Paper end - Adventure }