diff --git a/paper-server/patches/sources/net/minecraft/core/component/DataComponentPatch.java.patch b/paper-server/patches/sources/net/minecraft/core/component/DataComponentPatch.java.patch index b822091ea9..53846b237e 100644 --- a/paper-server/patches/sources/net/minecraft/core/component/DataComponentPatch.java.patch +++ b/paper-server/patches/sources/net/minecraft/core/component/DataComponentPatch.java.patch @@ -9,16 +9,22 @@ }); public static final StreamCodec STREAM_CODEC = new StreamCodec() { public DataComponentPatch decode(RegistryFriendlyByteBuf registryfriendlybytebuf) { -@@ -144,7 +144,7 @@ +@@ -144,7 +144,13 @@ } private static void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType type, Object value) { - type.streamCodec().encode(buf, value); ++ // Paper start - codec errors of random anonymous classes are useless ++ try { + type.streamCodec().encode(buf, (T) value); // CraftBukkit - decompile error ++ } catch (final Exception e) { ++ throw new RuntimeException("Error encoding component " + type, e); ++ } ++ // Paper end - codec errors of random anonymous classes are useless } }; private static final String REMOVED_PREFIX = "!"; -@@ -270,7 +270,43 @@ +@@ -270,7 +276,43 @@ private final Reference2ObjectMap, Optional> map = new Reference2ObjectArrayMap(); Builder() {}