From e74b5d661d521dca4dd497c2c1776c46d3082060 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 3 May 2023 15:22:21 +0200 Subject: [PATCH] 23w18a, maybe --- build.gradle.kts | 2 +- .../packets/BlockItemPackets1_20.java | 36 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cca4c612..041ab69a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.7.0-23w17a-SNAPSHOT" + version = "4.7.0-23w18a-SNAPSHOT" description = "Allow older clients to join newer server versions." } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java index e6e2e02f..ddd20793 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java @@ -79,7 +79,6 @@ public final class BlockItemPackets1_20 extends ItemRewriter { + wrapper.passthrough(Type.BOOLEAN); // Reset/clear + int size = wrapper.passthrough(Type.VAR_INT); // Mapping size + for (int i = 0; i < size; i++) { + wrapper.passthrough(Type.STRING); // Identifier + + // Parent + if (wrapper.passthrough(Type.BOOLEAN)) + wrapper.passthrough(Type.STRING); + + // Display data + if (wrapper.passthrough(Type.BOOLEAN)) { + wrapper.passthrough(Type.COMPONENT); // Title + wrapper.passthrough(Type.COMPONENT); // Description + handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Icon + wrapper.passthrough(Type.VAR_INT); // Frame type + int flags = wrapper.passthrough(Type.INT); // Flags + if ((flags & 1) != 0) { + wrapper.passthrough(Type.STRING); // Background texture + } + wrapper.passthrough(Type.FLOAT); // X + wrapper.passthrough(Type.FLOAT); // Y + } + + wrapper.passthrough(Type.STRING_ARRAY); // Criteria + + int arrayLength = wrapper.passthrough(Type.VAR_INT); + for (int array = 0; array < arrayLength; array++) { + wrapper.passthrough(Type.STRING_ARRAY); // String array + } + + wrapper.read(Type.BOOLEAN); // Sends telemetry + } + }); + protocol.registerClientbound(ClientboundPackets1_19_4.OPEN_SIGN_EDITOR, wrapper -> { final Position position = wrapper.passthrough(Type.POSITION1_14); final boolean frontSide = wrapper.read(Type.BOOLEAN);