diff options
author | Nassim Jahnke <[email protected]> | 2024-05-09 15:12:12 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-05-09 15:12:12 +0200 |
commit | f2512b12385961f8ca1f69efebe5ed0e00c0caa8 (patch) | |
tree | 19caaefc6a1f36c6c3db24f6b0cbd770fbd7134f | |
parent | ab2a85a35f8749bbb59132cf0d203213c9ef10f3 (diff) | |
download | Paper-f2512b12385961f8ca1f69efebe5ed0e00c0caa8.tar.gz Paper-f2512b12385961f8ca1f69efebe5ed0e00c0caa8.zip |
Print data component type on encoding error
-rw-r--r-- | patches/server/1048-Print-data-component-type-on-encoding-error.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/1048-Print-data-component-type-on-encoding-error.patch b/patches/server/1048-Print-data-component-type-on-encoding-error.patch new file mode 100644 index 0000000000..ca97f4b068 --- /dev/null +++ b/patches/server/1048-Print-data-component-type-on-encoding-error.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <[email protected]> +Date: Thu, 9 May 2024 15:11:34 +0200 +Subject: [PATCH] Print data component type on encoding error + + +diff --git a/src/main/java/net/minecraft/core/component/DataComponentPatch.java b/src/main/java/net/minecraft/core/component/DataComponentPatch.java +index 913327c9bb937c95e487ba21cf8e2084817bbfdb..f7632a099e1c6e214b5689375889eee7d6426e67 100644 +--- a/src/main/java/net/minecraft/core/component/DataComponentPatch.java ++++ b/src/main/java/net/minecraft/core/component/DataComponentPatch.java +@@ -143,7 +143,13 @@ public final class DataComponentPatch { + } + + private static <T> void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType<T> type, Object 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 = "!"; |