From 170e5f224fe2ae1f351cdbb78af0b5556e55b255 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 31 Jan 2024 22:58:11 +0100 Subject: [PATCH] Fix writable book handling in 1.16->1.15 --- .../packets/BlockItemPackets1_16.java | 4 +- .../BlockItemPacketRewriter1_20_3.java | 42 ------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java index 908bb119..3b1ac5e7 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java @@ -308,8 +308,8 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit } } - // Handle hover event changes in book pages - if ((item.identifier() == 758 || item.identifier() == 759) && tag != null) { + // Handle hover event changes in written book pages + if (item.identifier() == 759 && tag != null) { Tag pagesTag = tag.get("pages"); if (pagesTag instanceof ListTag) { for (Tag page : ((ListTag) pagesTag)) { diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java index fdda089c..5e3adbec 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java @@ -20,25 +20,16 @@ package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter; import com.viaversion.viabackwards.ViaBackwards; import com.viaversion.viabackwards.api.rewriters.ItemRewriter; import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.Protocol1_20_2To1_20_3; -import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.data.ParticleMappings; -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; import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_20_2; import com.viaversion.viaversion.api.type.types.version.Types1_20_3; -import com.viaversion.viaversion.libs.gson.JsonElement; -import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; -import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag; -import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag; -import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.rewriter.RecipeRewriter1_20_3; import com.viaversion.viaversion.rewriter.BlockRewriter; -import com.viaversion.viaversion.util.ComponentUtil; -import org.checkerframework.checker.nullness.qual.Nullable; public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter { @@ -164,37 +155,4 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter