private static void GetMinecraftManifest()
        {
            string manifestData = webClient.DownloadString(CommonData.mojangMinecraftManifestUrl);
            MojangMinecraftManifest mojangMinecraftManifest = JsonConvert.DeserializeObject <MojangMinecraftManifest>(manifestData);

            /* Record each available version */
            foreach (Version version in mojangMinecraftManifest.Versions)
            {
                if (version.Type == TypeEnum.Release)
                {
                    minecraftVersions.Add(version);
                }
            }

            /* Download forge manifest */
            int result = packageJson.BaseModLoader.MinecraftVersion.CompareTo("1.13.0");

            if (result >= 0)
            {
                if (packageJson.BaseModLoader.ForgeVersion.CompareTo("31.2.45") >= 0)
                {
                    forgeVersionJson            = null;
                    newForgeVersionJson         = null;
                    forgeV31InstallationProfile = ForgeV31InstallationProfile.FromJson(packageJson.BaseModLoader.InstallProfileJson);
                }
                else
                {
                    newForgeVersionJson      = NewForgeVersionJson.FromJson(packageJson.BaseModLoader.VersionJson);
                    forgeInstallationProfile = ForgeInstallationProfile.FromJson(packageJson.BaseModLoader.InstallProfileJson);
                    forgeVersionJson         = null;
                }
            }
            else
            {
                forgeVersionJson         = ForgeVersionJson.FromJson(packageJson.BaseModLoader.VersionJson);
                newForgeVersionJson      = null;
                forgeInstallationProfile = null;
            }
        }
Beispiel #2
0
 public static string ToJson(this ForgeVersionJson self) => JsonConvert.SerializeObject(self, Converter.Settings);