From 6cd6c8712759b051a2c871f13e86566702673faf Mon Sep 17 00:00:00 2001 From: KennyTV Date: Mon, 15 Jun 2020 20:11:21 +0200 Subject: [PATCH] 1.16 pre6 --- .../us/myles/ViaVersion/api/protocol/ProtocolVersion.java | 2 +- .../protocol1_16to1_15_2/packets/EntityPackets.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 9da819072..5128ba738 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 @@ -80,7 +80,7 @@ public class ProtocolVersion { register(v1_15 = new ProtocolVersion(573, "1.15")); register(v1_15_1 = new ProtocolVersion(575, "1.15.1")); register(v1_15_2 = new ProtocolVersion(578, "1.15.2")); - register(v1_16 = new ProtocolVersion(729, "1.16")); + register(v1_16 = new ProtocolVersion(730, "1.16")); register(unknown = new ProtocolVersion(-1, "UNKNOWN")); } diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/EntityPackets.java index ced5305ee..a02d67118 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/EntityPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/EntityPackets.java @@ -165,9 +165,11 @@ public class EntityPackets { @Override public void registerMap() { handler(DIMENSION_HANDLER); - map(Type.LONG); - map(Type.UNSIGNED_BYTE); + map(Type.LONG); // Seed + map(Type.UNSIGNED_BYTE); // Gamemode handler(wrapper -> { + wrapper.write(Type.BYTE, (byte) -1); // Previous gamemode, set to none + ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); String dimensionId = wrapper.get(Type.STRING, 0); clientWorld.setEnvironment(dimensionId); @@ -186,6 +188,7 @@ public class EntityPackets { map(Type.INT); // Entity ID map(Type.UNSIGNED_BYTE); // Gamemode handler(wrapper -> { + wrapper.write(Type.BYTE, (byte) -1); // Previous gamemode, set to none wrapper.write(Type.STRING_ARRAY, WORLD_NAMES); // World list - only used for command completion wrapper.write(Type.NBT, DIMENSIONS_TAG); // Dimension registry });