Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JObject json = JObject.Parse(File.ReadAllText(cnfg.folder + u_core + "core.json"));
- JArray libraries = (JArray)json["libraries"];
- JArray modLibraries = (JArray)json["modsLibraries"];
- string libs = "";
- foreach (JObject lib in libraries)
- {
- if (lib["artifact"] != null)
- libs += cnfg.folder + u_other + "libraries\\" + ((string)lib["artifact"]["path"]).Replace("/", "\\") + ';';
- else if(lib["packed"] != null)
- {
- string lb = ((string)lib["name"]).Split(':')[0].Replace('.','\\') + '\\' + ((string)lib["name"]).Split(':')[1] + '\\'
- + ((string)lib["name"]).Split(':')[1] + ".jar";
- libs += cnfg.folder + u_other + "libraries\\" + lb;
- }
- if (lib["classifies"] != null)
- if (lib["classifies"]["windows"] != null)
- libs+= cnfg.folder + u_other + "libraries\\" + ((string)lib["classifies"]["windows"]["path"]).Replace("/", "\\") + ';';
- }
- foreach (JObject lib in modLibraries)
- if (lib["artifact"] != null)
- libs += cnfg.folder + u_other + "libraries\\" + ((string)lib["artifact"]["path"]).Replace("/", "\\") + ';';
- string Ajava = "-Xmx${ram}M -Xms${ram}M -cp \"${core};${libs}\"".
- Replace("${ram}",cnfg.ram).
- Replace("${core}",cnfg.folder + u_core + json["id"] + ".jar").
- Replace("${libs}", libs.Substring(0,libs.Length - 1));
- string AMinecraft = json["mainClass"] + " -Djava.library.path=" + cnfg.folder + u_core + @"natives\ "
- + ((string)json["minecraftArguments"]).
- Replace("${auth_player_name}", cnfg.nick).
- Replace("${version_name}", (string)json["id"]).
- Replace("${game_directory}", cnfg.folder + u_other).
- Replace("${assets_root}", cnfg.folder + u_other + @"assets\").
- Replace("${assets_index_name}", (string)json["assetIndex"]["id"]).
- Replace("${auth_uuid}", "00000000000000000000000000000000").
- Replace("${auth_access_token}", "0").
- Replace("${user_properties}", "{}").
- Replace("${user_type}", "legacy");
- ProcessStartInfo info = new ProcessStartInfo("java",Ajava + " " + AMinecraft);
- Process.Start(info);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement