Paper/patches/server/1042-Print-data-component-type-on-encoding-error.patch
Spottedleaf 66cb880754 Remove ThreadedWorldUpgrader patch
The patch does not implement Vanilla forceUpgrade behavior.
Specifically, poi/entity conversion and regionfile recreation.

The Vanilla force upgrader is also no longer broken by CB, so the
bug fixes from this patch are not relevant anymore.
2024-05-21 08:21:28 -07:00

25 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
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 <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 = "!";