From 671c4d13418b765a720726f342fa9ecdf7edf90b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 22 Jul 2018 12:00:00 +1000 Subject: [PATCH] Minecraft 1.13 support --- .../net/md_5/bungee/protocol/Protocol.java | 30 ++++++++----------- .../bungee/protocol/ProtocolConstants.java | 2 +- .../main/java/net/md_5/bungee/Metrics.java | 2 +- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java index 28a1fea0..9509f8ee 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -243,43 +243,37 @@ public enum Protocol { { - TO_CLIENT.registerPacket( - LoginPayloadRequest.class, - map( ProtocolConstants.MINECRAFT_1_13, 0x00 ) - ); TO_CLIENT.registerPacket( Kick.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x01 ) + map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ); TO_CLIENT.registerPacket( EncryptionRequest.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x02 ) + map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ); TO_CLIENT.registerPacket( LoginSuccess.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x03 ) + map( ProtocolConstants.MINECRAFT_1_8, 0x02 ) ); TO_CLIENT.registerPacket( SetCompression.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x03 ), + map( ProtocolConstants.MINECRAFT_1_8, 0x03 ) + ); + TO_CLIENT.registerPacket( + LoginPayloadRequest.class, map( ProtocolConstants.MINECRAFT_1_13, 0x04 ) ); - TO_SERVER.registerPacket( - LoginPayloadResponse.class, - map( ProtocolConstants.MINECRAFT_1_13, 0x00 ) - ); TO_SERVER.registerPacket( LoginRequest.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x01 ) + map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ); TO_SERVER.registerPacket( EncryptionResponse.class, - map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), + map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) + ); + TO_SERVER.registerPacket( + LoginPayloadResponse.class, map( ProtocolConstants.MINECRAFT_1_13, 0x02 ) ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java index bba6cb2d..b2dc9423 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -17,7 +17,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_12 = 335; public static final int MINECRAFT_1_12_1 = 338; public static final int MINECRAFT_1_12_2 = 340; - public static final int MINECRAFT_1_13 = 389; + public static final int MINECRAFT_1_13 = 393; public static final List SUPPORTED_VERSIONS = Arrays.asList( "1.8.x", "1.9.x", diff --git a/proxy/src/main/java/net/md_5/bungee/Metrics.java b/proxy/src/main/java/net/md_5/bungee/Metrics.java index 95239878..a7ce8d82 100644 --- a/proxy/src/main/java/net/md_5/bungee/Metrics.java +++ b/proxy/src/main/java/net/md_5/bungee/Metrics.java @@ -21,7 +21,7 @@ public class Metrics extends TimerTask /** * The base url of the metrics domain */ - private static final String BASE_URL = "http://mcstats.org"; + private static final String BASE_URL = "https://mcstats.spigotmc.org"; /** * The url used to report a server's status */