From 4fb9fdab9b9a2732b587728e6841f28fe15265c4 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 23 May 2023 16:43:46 +0200 Subject: [PATCH] Add statistics handler to 1.19.4->1.19.3 protocol --- build.gradle.kts | 2 +- .../protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6a800f37..7d9a8424 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.7.0-1.20-pre3-SNAPSHOT" + version = "4.7.0-1.20-pre5-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 1c8b6824..a43679da 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 @@ -35,6 +35,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ClientboundPac import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.Protocol1_19_4To1_19_3; import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ServerboundPackets1_19_4; import com.viaversion.viaversion.rewriter.CommandRewriter; +import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.TagRewriter; import java.nio.charset.StandardCharsets; import java.util.Base64; @@ -98,6 +99,8 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol(this).register(ClientboundPackets1_19_4.STATISTICS); + registerClientbound(ClientboundPackets1_19_4.SERVER_DATA, wrapper -> { final JsonElement element = wrapper.read(Type.COMPONENT); wrapper.write(Type.OPTIONAL_COMPONENT, element);