From 565944c3178c6243242d4b5597f57f76016e0bbc Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 1 Mar 2023 16:09:56 +0100 Subject: [PATCH] Handle new container id --- build.gradle.kts | 2 +- .../Protocol1_19_3To1_19_4.java | 1 - .../packets/BlockItemPackets1_19_4.java | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2f07c36e..74a015e8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.6.0-1.19.4-pre1-SNAPSHOT" + version = "4.6.0-1.19.4-pre3-SNAPSHOT" description = "Allow older clients to join newer server versions." } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java index 8e2e45fc..036498b5 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java @@ -66,7 +66,6 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol { + final int windowType = wrapper.get(Type.VAR_INT, 1); + if (windowType == 21) { // New smithing menu + wrapper.cancel(); + } else if (windowType > 21) { + wrapper.set(Type.VAR_INT, 1, windowType - 1); + } + + protocol.getTranslatableRewriter().processText(wrapper.get(Type.COMPONENT, 0)); + }); + } + }); + registerSetCooldown(ClientboundPackets1_19_4.COOLDOWN); registerWindowItems1_17_1(ClientboundPackets1_19_4.WINDOW_ITEMS); registerSetSlot1_17_1(ClientboundPackets1_19_4.SET_SLOT);