From bc6ad16d401b83fc94278faa983cfaa99bde00d5 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Fri, 1 Nov 2024 18:50:54 +0100 Subject: [PATCH] Properly remove custom_data component if we created it in 1.20.5+ protocols (#4229) --- .../rewriter/BlockItemPacketRewriter1_21.java | 33 ++++++++----------- .../BlockItemPacketRewriter1_21_2.java | 8 ++--- .../rewriter/StructuredItemRewriter.java | 13 ++++++++ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java index d95204ab3..ed21ef5ec 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/rewriter/BlockItemPacketRewriter1_21.java @@ -136,14 +136,13 @@ public final class BlockItemPacketRewriter1_21 extends StructuredItemRewriter> extends ItemRewriter { + public static final String MARKER_KEY = "VV|custom_data"; + public StructuredItemRewriter( T protocol, Type itemType, Type itemArrayType, Type mappedItemType, Type mappedItemArrayType, @@ -205,15 +207,18 @@ public class StructuredItemRewriter