From a8d13fadb33b1265e937e02c5cd82ab243c47096 Mon Sep 17 00:00:00 2001
From: KennyTV <28825609+KennyTV@users.noreply.github.com>
Date: Mon, 3 Jun 2019 20:21:33 +0200
Subject: [PATCH] 1.14.3 pre-1
---
bukkit/pom.xml | 2 +-
bungee/pom.xml | 2 +-
common/pom.xml | 2 +-
.../api/protocol/ProtocolRegistry.java | 4 +-
.../api/protocol/ProtocolVersion.java | 2 +
.../Protocol1_14_3To1_14_2.java | 51 +++++++++++++++++++
jar/pom.xml | 2 +-
pom.xml | 2 +-
sponge-legacy/pom.xml | 2 +-
sponge/pom.xml | 2 +-
velocity/pom.xml | 2 +-
11 files changed, 64 insertions(+), 9 deletions(-)
create mode 100644 common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_3to1_14_2/Protocol1_14_3To1_14_2.java
diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index 8f2ff1233..a11c94f4e 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
diff --git a/bungee/pom.xml b/bungee/pom.xml
index 8c79373a0..0f7cec5fb 100644
--- a/bungee/pom.xml
+++ b/bungee/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
diff --git a/common/pom.xml b/common/pom.xml
index 6f79eec06..3fdf97815 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
index 42fca79f9..f8368bee1 100644
--- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
+++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
@@ -13,17 +13,18 @@ import us.myles.ViaVersion.protocols.protocol1_11to1_10.Protocol1_11To1_10;
import us.myles.ViaVersion.protocols.protocol1_12_1to1_12.Protocol1_12_1To1_12;
import us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1.Protocol1_12_2To1_12_1;
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
+import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13;
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.Protocol1_14_1To1_14;
import us.myles.ViaVersion.protocols.protocol1_14_2to1_14_1.Protocol1_14_2To1_14_1;
+import us.myles.ViaVersion.protocols.protocol1_14_3to1_14_2.Protocol1_14_3To1_14_2;
import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2To1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1To1_9;
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.Protocol1_9_3To1_9_1_2;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
import us.myles.ViaVersion.protocols.protocol1_9to1_9_1.Protocol1_9To1_9_1;
-import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -66,6 +67,7 @@ public class ProtocolRegistry {
registerProtocol(new Protocol1_14To1_13_2(), Arrays.asList(ProtocolVersion.v1_14.getId()), ProtocolVersion.v1_13_2.getId());
registerProtocol(new Protocol1_14_1To1_14(), Arrays.asList(ProtocolVersion.v1_14_1.getId()), ProtocolVersion.v1_14.getId());
registerProtocol(new Protocol1_14_2To1_14_1(), Arrays.asList(ProtocolVersion.v1_14_2.getId()), ProtocolVersion.v1_14_1.getId());
+ registerProtocol(new Protocol1_14_3To1_14_2(), Arrays.asList(ProtocolVersion.v1_14_3.getId()), ProtocolVersion.v1_14_2.getId());
}
/**
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 85351fbaa..2bac4757b 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
@@ -38,6 +38,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_14;
public static final ProtocolVersion v1_14_1;
public static final ProtocolVersion v1_14_2;
+ public static final ProtocolVersion v1_14_3;
public static final ProtocolVersion unknown;
private final int id;
@@ -72,6 +73,7 @@ public class ProtocolVersion {
register(v1_14 = new ProtocolVersion(477, "1.14"));
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(486, "1.14.3"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_3to1_14_2/Protocol1_14_3To1_14_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_3to1_14_2/Protocol1_14_3To1_14_2.java
new file mode 100644
index 000000000..a203ef542
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_3to1_14_2/Protocol1_14_3To1_14_2.java
@@ -0,0 +1,51 @@
+package us.myles.ViaVersion.protocols.protocol1_14_3to1_14_2;
+
+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_3To1_14_2 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.passthrough(Type.VAR_INT);
+ wrapper.passthrough(Type.VAR_INT);
+ wrapper.passthrough(Type.BOOLEAN);
+
+ wrapper.write(Type.BOOLEAN, true); // new "restockable" boolean added in pre-1
+ }
+ });
+ }
+ });
+ }
+
+ @Override
+ public void init(UserConnection userConnection) {
+ }
+}
diff --git a/jar/pom.xml b/jar/pom.xml
index 674d3a4ad..2179bd614 100644
--- a/jar/pom.xml
+++ b/jar/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
viaversion-jar
diff --git a/pom.xml b/pom.xml
index 61b708dce..49cad27b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
us.myles
viaversion-parent
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
pom
viaversion-parent
diff --git a/sponge-legacy/pom.xml b/sponge-legacy/pom.xml
index ced1e6ce0..bc8cdfa3d 100644
--- a/sponge-legacy/pom.xml
+++ b/sponge-legacy/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
diff --git a/sponge/pom.xml b/sponge/pom.xml
index 9a0406c00..dd8af63a4 100644
--- a/sponge/pom.xml
+++ b/sponge/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0
diff --git a/velocity/pom.xml b/velocity/pom.xml
index c7404d0ef..299d44771 100644
--- a/velocity/pom.xml
+++ b/velocity/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.1.2-SNAPSHOT
+ 2.2.0-1.14.3-pre1
4.0.0