From cfc9011cee0729583bab75339ade51763a4f4ac6 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 27 Jan 2024 20:51:28 +0100 Subject: [PATCH] Push books through component conversion in 1.20.2->1.20.3 Fixes #3579 --- .../BlockItemPacketRewriter1_20_3.java | 39 +++++++++++++++++++ .../viaversion/util/ComponentUtil.java | 11 ++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/BlockItemPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/BlockItemPacketRewriter1_20_3.java index 6bd6bc9b0..ffa276cc2 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/BlockItemPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/BlockItemPacketRewriter1_20_3.java @@ -17,8 +17,14 @@ */ package com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.rewriter; +import com.github.steveice10.opennbt.tag.builtin.CompoundTag; +import com.github.steveice10.opennbt.tag.builtin.ListTag; +import com.github.steveice10.opennbt.tag.builtin.StringTag; +import com.github.steveice10.opennbt.tag.builtin.Tag; +import com.google.gson.JsonElement; import com.viaversion.viaversion.api.data.ParticleMappings; import com.viaversion.viaversion.api.minecraft.Particle; +import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; @@ -30,7 +36,9 @@ import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3 import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3; import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.ItemRewriter; +import com.viaversion.viaversion.util.ComponentUtil; import com.viaversion.viaversion.util.Key; +import org.checkerframework.checker.nullness.qual.Nullable; public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter { @@ -125,4 +133,35 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter= SerializerVersion.V1_16.ordinal() && to.ordinal() < SerializerVersion.V1_16.ordinal()) { // Convert hover event to legacy format final Style style = component.getStyle();