From bc09187dc1fc1626251f0e8f00cd352679573101 Mon Sep 17 00:00:00 2001 From: KennyTV <28825609+KennyTV@users.noreply.github.com> Date: Mon, 15 Jul 2019 14:58:55 +0200 Subject: [PATCH] 1.14.4-pre6 support --- bukkit/pom.xml | 2 +- bungee/pom.xml | 2 +- common/pom.xml | 2 +- .../api/protocol/ProtocolVersion.java | 2 +- .../Protocol1_14_4To1_14_3.java | 32 +++++++++++++++++++ jar/pom.xml | 2 +- pom.xml | 2 +- sponge-legacy/pom.xml | 2 +- sponge/pom.xml | 2 +- velocity/pom.xml | 2 +- 10 files changed, 41 insertions(+), 9 deletions(-) diff --git a/bukkit/pom.xml b/bukkit/pom.xml index f9e3df688..c3aefb5a6 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 diff --git a/bungee/pom.xml b/bungee/pom.xml index 86adccc70..b01df3710 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 diff --git a/common/pom.xml b/common/pom.xml index 077b6b91b..ad05d6432 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java index ff520d2b4..94f3ff7f8 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java @@ -75,7 +75,7 @@ public class ProtocolVersion { register(v1_14_1 = new ProtocolVersion(480, "1.14.1")); register(v1_14_2 = new ProtocolVersion(485, "1.14.2")); register(v1_14_3 = new ProtocolVersion(490, "1.14.3")); - register(v1_14_4 = new ProtocolVersion(491, "1.14.4")); + register(v1_14_4 = new ProtocolVersion(496, "1.14.4")); register(unknown = new ProtocolVersion(-1, "UNKNOWN")); } diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_4to1_14_3/Protocol1_14_4To1_14_3.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_4to1_14_3/Protocol1_14_4To1_14_3.java index b6397cd1e..8c571275e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_4to1_14_3/Protocol1_14_4To1_14_3.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_4to1_14_3/Protocol1_14_4To1_14_3.java @@ -1,12 +1,44 @@ package us.myles.ViaVersion.protocols.protocol1_14_4to1_14_3; +import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.protocol.Protocol; +import us.myles.ViaVersion.api.remapper.PacketHandler; +import us.myles.ViaVersion.api.remapper.PacketRemapper; +import us.myles.ViaVersion.api.type.Type; +import us.myles.ViaVersion.packets.State; public class Protocol1_14_4To1_14_3 extends Protocol { @Override protected void registerPackets() { + // trade list + registerOutgoing(State.PLAY, 0x27, 0x27, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + wrapper.passthrough(Type.VAR_INT); + int size = wrapper.passthrough(Type.UNSIGNED_BYTE); + for (int i = 0; i < size; i++) { + wrapper.passthrough(Type.FLAT_VAR_INT_ITEM); + wrapper.passthrough(Type.FLAT_VAR_INT_ITEM); + if (wrapper.passthrough(Type.BOOLEAN)) { + wrapper.passthrough(Type.FLAT_VAR_INT_ITEM); + } + wrapper.passthrough(Type.BOOLEAN); + wrapper.passthrough(Type.INT); + wrapper.passthrough(Type.INT); + wrapper.passthrough(Type.INT); + wrapper.passthrough(Type.INT); + wrapper.passthrough(Type.FLOAT); + wrapper.write(Type.INT, 0); // demand value added in pre5 + } + } + }); + } + }); } @Override diff --git a/jar/pom.xml b/jar/pom.xml index be7ce310f..99d278658 100644 --- a/jar/pom.xml +++ b/jar/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 viaversion-jar diff --git a/pom.xml b/pom.xml index c40660cb4..79a3063ab 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ us.myles viaversion-parent - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 pom viaversion-parent diff --git a/sponge-legacy/pom.xml b/sponge-legacy/pom.xml index c73e26091..62f5e8a59 100644 --- a/sponge-legacy/pom.xml +++ b/sponge-legacy/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 diff --git a/sponge/pom.xml b/sponge/pom.xml index 440da60ba..e0339174e 100644 --- a/sponge/pom.xml +++ b/sponge/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0 diff --git a/velocity/pom.xml b/velocity/pom.xml index 81b80c6e6..8d6df5f2d 100644 --- a/velocity/pom.xml +++ b/velocity/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 2.1.4-1.14.4-pre1 + 2.1.3-1.14.4-pre6 4.0.0