diff --git a/MinecraftClient/Mapping/Material.cs b/MinecraftClient/Mapping/Material.cs index 47348d57..3a73ec64 100644 --- a/MinecraftClient/Mapping/Material.cs +++ b/MinecraftClient/Mapping/Material.cs @@ -4,7 +4,13 @@ /// Represents Minecraft Materials /// /// - /// Generated from blocks.json using PaletteGenerator.cs + /// Generated from blocks.json using PaletteGenerator.cs. + /// Typical steps to handle new blocks for newer Minecraft versions: + /// 1. Generate blocks.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators) + /// 2. Generate temporary MaterialXXX.cs and PaletteXXX.cs using PaletteGenerator.cs + /// 3. Perform a diff with existing versions, add missing entries in Material.cs and MaterialExtensions.cs + /// 4. If existing state IDs were not randomized by Mojang, simply add missing state entries to Palette113.cs + /// 5. If existing state IDs were randomized, add a new palette as PaletteXXX.cs into the codebase (worst case) /// public enum Material { diff --git a/MinecraftClient/McTcpClient.cs b/MinecraftClient/McTcpClient.cs index 2146e695..755619ab 100644 --- a/MinecraftClient/McTcpClient.cs +++ b/MinecraftClient/McTcpClient.cs @@ -16,7 +16,6 @@ namespace MinecraftClient /// /// The main client class, used to connect to a Minecraft server. /// - public class McTcpClient : IMinecraftComHandler { public static int ReconnectionAttemptsLeft = 0; diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index 02977a55..976ec146 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -16,6 +16,13 @@ namespace MinecraftClient /// Allows to connect to any Minecraft server, send and receive text, automated scripts. /// This source code is released under the CDDL 1.0 License. /// + /// + /// Typical steps to update MCC for a new Minecraft version + /// - Implement protocol changes (see Protocol18.cs) + /// - Handle new block types and states (see Material.cs) + /// - Mark new version as handled (see ProtocolHandler.cs) + /// - Update MCHighestVersion field below (for versionning) + /// static class Program { private static McTcpClient Client; diff --git a/MinecraftClient/Properties/AssemblyInfo.cs b/MinecraftClient/Properties/AssemblyInfo.cs index 604bed7a..12ec255e 100644 --- a/MinecraftClient/Properties/AssemblyInfo.cs +++ b/MinecraftClient/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; //[assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("https://github.com/ORelio/Minecraft-Console-Client")] [assembly: AssemblyProduct("MinecraftClient")] -[assembly: AssemblyCopyright("Copyright © 2012-2018 ORelio & Contributors")] +[assembly: AssemblyCopyright("Copyright © 2012-2019 ORelio & Contributors")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -39,4 +39,4 @@ using System.Runtime.InteropServices; // MCC will use the following command as CMD pre-build script in AppVeyor msbuild settings: // echo [assembly: AssemblyConfiguration("AppVeyor build %APPVEYOR_BUILD_NUMBER%, built on %DATE% from commit %APPVEYOR_REPO_COMMIT:~0,7%")] >> MinecraftClient\Properties\AssemblyInfo.cs // The command will add build info like the example below to be incorporated in Assembly Info in order to display build info on launch -// [assembly: AssemblyConfiguration("AppVeyor build 1234, built on Sun 31/12/2017 from commit abc1def")] \ No newline at end of file +// [assembly: AssemblyConfiguration("AppVeyor build 1234, built on Sun 31/12/2017 from commit abc1def")] diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 4d5e6f0a..f2731808 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -16,6 +16,12 @@ namespace MinecraftClient.Protocol.Handlers /// /// Implementation for Minecraft 1.7.X+ Protocols /// + /// + /// Typical update steps for implementing protocol changes for a new Minecraft version: + /// - Perform a diff between latest supported version in MCC and new stable version to support on https://wiki.vg/Protocol + /// - If there are any changes in packets implemented by MCC, add MCXXXVersion field below and implement new packet layouts + /// - If packet IDs were changed, also update getPacketIncomingType() and getPacketOutgoingID() + /// class Protocol18Handler : IMinecraftCom { private const int MC18Version = 47; diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index b6953a62..06a5c8e0 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -14,6 +14,11 @@ namespace MinecraftClient.Protocol /// /// Handle login, session, server ping and provide a protocol handler for interacting with a minecraft server. /// + /// + /// Typical update steps for marking a new Minecraft version as supported: + /// - Add protocol ID in GetProtocolHandler() + /// - Add 1.X.X case in MCVer2ProtocolVersion() + /// public static class ProtocolHandler { /// @@ -106,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 }; + int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404 }; 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."); @@ -526,6 +531,7 @@ namespace MinecraftClient.Protocol private static string JsonEncode(string text) { StringBuilder result = new StringBuilder(); + foreach (char c in text) { if ((c >= '0' && c <= '9') ||