From 1f7b8ba5d5d0455331acbcfd3e8b6c58c0d62236 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Mon, 23 Dec 2019 18:47:31 +0100 Subject: [PATCH] Update Nukkit Protocol Library to 1.14 (#117) * Update nukkit protocolib to 1.14 * Fixes * Remove debug --- connector/pom.xml | 4 ++-- .../main/java/org/geysermc/connector/GeyserConnector.java | 5 ++--- .../geysermc/connector/network/UpstreamPacketHandler.java | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml index ee8b9049e..82e3adb11 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -66,8 +66,8 @@ com.nukkitx.protocol - bedrock-v388 - 2.4.2 + bedrock-v389 + 2.4.4 compile diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 46443ffa0..8b6638da7 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -27,7 +27,7 @@ package org.geysermc.connector; import com.nukkitx.protocol.bedrock.BedrockPacketCodec; import com.nukkitx.protocol.bedrock.BedrockServer; -import com.nukkitx.protocol.bedrock.v388.Bedrock_v388; +import com.nukkitx.protocol.bedrock.v389.Bedrock_v389; import lombok.Getter; import org.fusesource.jansi.AnsiConsole; @@ -67,8 +67,7 @@ import java.util.concurrent.TimeUnit; @Getter public class GeyserConnector implements Connector { - public static final BedrockPacketCodec BEDROCK_PACKET_CODEC = Bedrock_v388.V388_CODEC; - public static final int BEDROCK_1_14_PROTOCOL_VERSION = 389; + public static final BedrockPacketCodec BEDROCK_PACKET_CODEC = Bedrock_v389.V389_CODEC; public static final String NAME = "Geyser"; public static final String VERSION = "1.0-SNAPSHOT"; diff --git a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java index 555e54e65..9768c88b5 100644 --- a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java +++ b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java @@ -45,7 +45,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { @Override public boolean handle(LoginPacket loginPacket) { - if (loginPacket.getProtocolVersion() != GeyserConnector.BEDROCK_1_14_PROTOCOL_VERSION) { + if (loginPacket.getProtocolVersion() != GeyserConnector.BEDROCK_PACKET_CODEC.getProtocolVersion()) { session.getUpstream().disconnect("Unsupported Bedrock version. Are you running an outdated version?"); return true; } @@ -131,4 +131,4 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { public boolean handle(InventoryTransactionPacket packet) { return translateAndDefault(packet); } -} \ No newline at end of file +}