c# - Minecraft not starting -
i in project of launcher minecraft, without using java! c#.
i have code not know what's going wrong, java open closes.
public void runminecraft() { list<string> j_args = new list<string>(); list<string> libraries = new list<string>(); args = ""; int x = convert.toint32(numericupdown1.value); j_args.add("-xx:heapdumppath=mojangtricksinteldriversforperformance_javaw.exe_minecraft.exe.heapdump"); j_args.add("-xmx" + x + "g"); j_args.add("-djava.library.path=" + application.startuppath + "\\data\\natives"); j_args.add("net.minecraft.client.main.main"); string lib = application.startuppath + "\\data\\libraries\\{0}"; string app = application.startuppath; string game = application.startuppath + "\\data\\game"; string assets = application.startuppath + "\\data\\assets"; #region libraries libraries.add(format2(lib, "oshi-core-1.1.jar")); libraries.add(format2(lib, "jna-3.4.0.jar")); libraries.add(format2(lib, "platform-3.4.0.jar")); libraries.add(format2(lib, "icu4j-core-mojang-51.2.jar")); libraries.add(format2(lib, "jopt-simple-4.6.jar")); libraries.add(format2(lib, "codecjorbis-20101023.jar")); libraries.add(format2(lib, "codecwav-20101023.jar")); libraries.add(format2(lib, "libraryjavasound-20101123.jar")); libraries.add(format2(lib, "librarylwjglopenal-20100824.jar")); libraries.add(format2(lib, "soundsystem-20120107.jar")); libraries.add(format2(lib, "netty-all-4.0.23.final.jar")); libraries.add(format2(lib, "guava-17.0.jar")); libraries.add(format2(lib, "commons-lang3-3.3.2.jar")); libraries.add(format2(lib, "commons-io-2.4.jar")); libraries.add(format2(lib, "commons-codec-1.9.jar")); libraries.add(format2(lib, "jinput-2.0.5.jar")); libraries.add(format2(lib, "jutils-1.0.0.jar")); libraries.add(format2(lib, "gson-2.2.4.jar")); libraries.add(format2(lib, "authlib-1.5.21.jar")); libraries.add(format2(lib, "realms-1.7.48.jar")); libraries.add(format2(lib, "httpcore-4.3.2.jar")); libraries.add(format2(lib, "log4j-api-2.0-beta9.jar")); libraries.add(format2(lib, "log4j-core-2.0-beta9.jar")); libraries.add(format3(lib, "1.8.6.jar")); #endregion var librariesstr = ""; var enum0 = libraries.getenumerator(); while (enum0.movenext()) { librariesstr += enum0.current; } j_args.add("-cp " + librariesstr); j_args.add("--username " + username.text); j_args.add("--accesstoken " + accesstoken.text); j_args.add("--userproperties {}"); j_args.add("--version 1.8.6"); j_args.add("--gamedir " + game); var argsstr = ""; var enum1 = j_args.getenumerator(); while (enum1.movenext()) { argsstr += enum1.current + " "; } processstartinfo info = new processstartinfo(); info.filename = @"c:\program files\java\jre7\bin\java.exe"; info.arguments = args; info.useshellexecute = false; info.redirectstandardoutput = true; info.redirectstandarderror = true; process p = new process(); p.startinfo = info; p.outputdatareceived += p_outputdatareceived; info.createnowindow = true; p.start(); p.beginoutputreadline(); // clipboard.settext(argsstr); } private string format3(string a, string b) { return string.format(a, b); } #region format2 private string format2(string a, string b) { return string.format(a, b) + ";"; } #endregion
i use format2 function cause formatting of libraries correctly. example:
libraries.add("unnamed_lib1.jar"); libraries.add ("unnamed_lib2.jar");
the result this:
args = "unnamed_lib1.jar;unnamed_lib2.jar;";
and function format3(string a, string b); event finish jar file of game. example: "1.8.9.jar" without ';' @ end
sorry misspelling because not speak english. , using google translator me texts.
i'm using 1.8.6 version of minecraft start
place -cp
(classpath) arguments before net.minecraft.client.main.main
, or considered arguments application (main
class), not javaw
executable.
it (i wrote of arguments, ommited java.exe , maybe other things) :
j_args.add("-xx:heapdumppath=mojangtricksinteldriversforperformance_javaw.exe_minecraft.exe.heapdump"); j_args.add("-xmx" + x + "g"); j_args.add("-djava.library.path=" + application.startuppath + "\\data\\natives"); j_args.add("-cp " + librariesstr); j_args.add("net.minecraft.client.main.main"); j_args.add("--username " + username.text); j_args.add("--accesstoken " + accesstoken.text); j_args.add("--userproperties {}"); j_args.add("--version 1.8.6"); j_args.add("--gamedir " + game);
Comments
Post a Comment