From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke 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 33340e8ebe23a1a9ce587be34551fb929c41d0fd..b8977749d35dd7343021425f477445bec470d46b 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 void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType 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 = "!";