From 921ec5aaf57bdefc80c54790859dcd1a8a1b4aa4 Mon Sep 17 00:00:00 2001 From: rvankammen Date: Fri, 7 Feb 2020 17:22:55 +0100 Subject: [PATCH] Added the 1.15.2 protocol --- MinecraftClient/Program.cs | 2 +- MinecraftClient/Protocol/Handlers/Protocol18.cs | 5 +++-- MinecraftClient/Protocol/ProtocolHandler.cs | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index 63c60eb5..970f62a7 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -30,7 +30,7 @@ namespace MinecraftClient public const string Version = MCHighestVersion; public const string MCLowestVersion = "1.4.6"; - public const string MCHighestVersion = "1.15.1"; + public const string MCHighestVersion = "1.15.2"; public static readonly string BuildInfo = null; private static Thread offlinePrompt = null; diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 9aeada68..12102723 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -35,6 +35,7 @@ namespace MinecraftClient.Protocol.Handlers internal const int MC114Version = 477; internal const int MC115Version = 573; internal const int MC1151Version = 575; + internal const int MC1152Version = 578; private int compression_treshold = 0; private bool autocomplete_received = false; @@ -62,7 +63,7 @@ namespace MinecraftClient.Protocol.Handlers this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, handler); this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler); - if (handler.GetTerrainEnabled() && protocolversion > MC1151Version) + if (handler.GetTerrainEnabled() && protocolversion > MC1152Version) { ConsoleIO.WriteLineFormatted("ยง8Terrain & Movements currently not handled for that MC version."); handler.SetTerrainEnabled(false); @@ -76,7 +77,7 @@ namespace MinecraftClient.Protocol.Handlers if (protocolversion >= MC113Version) { - if (protocolVersion > MC1151Version && handler.GetTerrainEnabled()) + if (protocolVersion > MC1152Version && handler.GetTerrainEnabled()) throw new NotImplementedException("Please update block types handling for this Minecraft version. See Material.cs"); if (protocolVersion >= MC115Version) Block.Palette = new Palette115(); diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index fbb813cc..c621dff3 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -111,7 +111,7 @@ namespace MinecraftClient.Protocol int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1) return new Protocol16Handler(Client, ProtocolVersion, Handler); - int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575 }; + int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575, 578}; if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1) return new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo); throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported."); @@ -216,6 +216,8 @@ namespace MinecraftClient.Protocol return 573; case "1.15.1": return 575; + case "1.15.2": + return 578; default: return 0; }