From b6ba7dcc4494cd829b42af87ce487d5b0943d1a5 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 9 Jan 2024 17:18:32 +0100 Subject: [PATCH] Handle 1.20->1.20.2 tags --- .../protocol1_20_2to1_20/Protocol1_20_2To1_20.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java index 826ca3285..4f233c64e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java @@ -51,6 +51,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.Configur import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastTags; import com.viaversion.viaversion.rewriter.SoundRewriter; +import com.viaversion.viaversion.rewriter.TagRewriter; import com.viaversion.viaversion.util.Key; import java.util.UUID; import org.checkerframework.checker.nullness.qual.Nullable; @@ -85,9 +86,15 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol wrapper.user().put(new LastTags(wrapper))); - registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), - wrapper -> wrapper.user().put(new LastTags(wrapper))); + final TagRewriter tagRewriter = new TagRewriter<>(this); + registerClientbound(ClientboundPackets1_19_4.TAGS, wrapper -> { + tagRewriter.getGenericHandler().handle(wrapper); + wrapper.user().put(new LastTags(wrapper)); + }); + registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), ClientboundConfigurationPackets1_20_2.UPDATE_TAGS.getId(), wrapper -> { + tagRewriter.getGenericHandler().handle(wrapper); + wrapper.user().put(new LastTags(wrapper)); + }); registerClientbound(ClientboundPackets1_19_4.DISPLAY_SCOREBOARD, wrapper -> { final byte slot = wrapper.read(Type.BYTE);