mirror of
https://github.com/PaperMC/Paper.git
synced 2024-08-25 06:03:03 +02:00
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: masmc05 <masmc05@gmail.com>
25 lines
1.3 KiB
Diff
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 = "!";
|