From 9bfb2bf6c7b6d6c016724a1ce2ba0e8dfef634d6 Mon Sep 17 00:00:00 2001 From: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com> Date: Fri, 11 Sep 2020 22:58:10 +0800 Subject: [PATCH] Update supported version to 1.16.3 Nothing got changed in 1.16.3 --- MinecraftClient/Program.cs | 2 +- .../Protocol/Handlers/PacketType18Handler.cs | 2 +- MinecraftClient/Protocol/Handlers/Protocol18.cs | 13 +++++++------ MinecraftClient/Protocol/ProtocolHandler.cs | 4 +++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index deaa7267..e07cc755 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -32,7 +32,7 @@ namespace MinecraftClient public const string Version = MCHighestVersion; public const string MCLowestVersion = "1.4.6"; - public const string MCHighestVersion = "1.16.2"; + public const string MCHighestVersion = "1.16.3"; public static readonly string BuildInfo = null; private static Thread offlinePrompt = null; diff --git a/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs b/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs index 8a78cbae..2e60e148 100644 --- a/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs +++ b/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs @@ -39,7 +39,7 @@ namespace MinecraftClient.Protocol.Handlers /// public PacketTypePalette GetTypeHandler(int protocol) { - if (protocol > Protocol18Handler.MC1162Version) + if (protocol > Protocol18Handler.MC1163Version) throw new NotImplementedException("Please update packet type palette for this Minecraft version. See PacketTypePalette.cs"); if (protocol <= Protocol18Handler.MC18Version) return new PacketPalette17(); diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index ec2c1865..83cbe158 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -46,6 +46,7 @@ namespace MinecraftClient.Protocol.Handlers internal const int MC116Version = 735; internal const int MC1161Version = 736; internal const int MC1162Version = 751; + internal const int MC1163Version = 753; private int compression_treshold = 0; private bool autocomplete_received = false; @@ -84,13 +85,13 @@ namespace MinecraftClient.Protocol.Handlers handler.SetTerrainEnabled(false); } - if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1162Version)) + if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1163Version)) { ConsoleIO.WriteLineFormatted("§8Inventories are currently not handled for that MC version."); handler.SetInventoryEnabled(false); } - if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1162Version)) + if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1163Version)) { ConsoleIO.WriteLineFormatted("§8Entities are currently not handled for that MC version."); handler.SetEntityHandlingEnabled(false); @@ -112,9 +113,9 @@ namespace MinecraftClient.Protocol.Handlers // Entity palette if (protocolversion >= MC113Version) { - if (protocolversion > MC1162Version && handler.GetEntityHandlingEnabled()) + if (protocolversion > MC1163Version && handler.GetEntityHandlingEnabled()) throw new NotImplementedException("Please update entity types handling for this Minecraft version. See EntityType.cs"); - if (protocolversion >= MC1162Version) + if (protocolversion >= MC1163Version) entityPalette = new EntityPalette1162(); else if (protocolversion >= MC116Version) entityPalette = new EntityPalette1161(); @@ -129,9 +130,9 @@ namespace MinecraftClient.Protocol.Handlers // Item palette if (protocolversion >= MC116Version) { - if (protocolversion > MC1162Version && handler.GetInventoryEnabled()) + if (protocolversion > MC1163Version && handler.GetInventoryEnabled()) throw new NotImplementedException("Please update item types handling for this Minecraft version. See ItemType.cs"); - if (protocolversion >= MC1162Version) + if (protocolversion >= MC1163Version) itemPalette = new ItemPalette1162(); else itemPalette = new ItemPalette1161(); } diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index c7837b52..11952e68 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -126,7 +126,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, 578, 735, 736, 751 }; + 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, 735, 736, 751, 753 }; 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."); @@ -240,6 +240,8 @@ namespace MinecraftClient.Protocol return 736; case "1.16.2": return 751; + case "1.16.3": + return 753; default: return 0; }