From aae59658ecc1a3fc6b2275506ef7d213407f3111 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 22 Feb 2023 18:54:41 +0100 Subject: [PATCH] 23w08a --- build.gradle.kts | 2 +- .../Protocol1_19_3To1_19_4.java | 25 +++++++++++++------ .../packets/EntityPackets1_19_4.java | 14 +++++++++++ .../data/mapping-1.19.3to1.19.4.json | 3 +++ gradle/libs.versions.toml | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ebe94560..751a2e0a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.6.0-23w07a-SNAPSHOT" + version = "4.6.0-23w08a-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 19f2d690..8e2e45fc 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 @@ -75,14 +75,22 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol(this) { @Override public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception { - if (argumentType.equals("minecraft:time")) { - wrapper.read(Type.INT); // Minimum - } else if (argumentType.equals("minecraft:resource") || argumentType.equals("minecraft:resource_or_tag")) { - final String resource = wrapper.read(Type.STRING); - // Replace damage types with... something - wrapper.write(Type.STRING, resource.equals("minecraft:damage_type") ? "minecraft:mob_effect" : resource); - } else { - super.handleArgument(wrapper, argumentType); + switch (argumentType) { + case "minecraft:heightmap": + wrapper.write(Type.VAR_INT, 0); + break; + case "minecraft:time": + wrapper.read(Type.INT); // Minimum + break; + case "minecraft:resource": + case "minecraft:resource_or_tag": + final String resource = wrapper.read(Type.STRING); + // Replace damage types with... something + wrapper.write(Type.STRING, resource.equals("minecraft:damage_type") ? "minecraft:mob_effect" : resource); + break; + default: + super.handleArgument(wrapper, argumentType); + break; } } }.registerDeclareCommands1_19(ClientboundPackets1_19_4.DECLARE_COMMANDS); @@ -101,6 +109,7 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol