offline-minecraft-launcher/oml/stages/launch.py

14 lines
533 B
Python
Raw Normal View History

print(colored(colorama.Fore.GREEN,"\nLaunching Minecraft..."))
if lv["console"] == "1":
2022-05-18 00:32:22 +00:00
proc = subprocess.Popen([javaExe] + args)
rtn = proc.wait()
if rtn != 0: print(colored(colorama.Fore.RED,"> Launch failed: ") +"return isn't 0",file=sys.stderr)
2022-05-18 00:32:22 +00:00
sys.exit(rtn)
else:
pkwargs = {
"stdout": subprocess.DEVNULL,
"stdin": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
}
if lv["osName"] == "windows": pkwargs["creationflags"] = 0x00000008
2022-05-18 00:32:22 +00:00
subprocess.Popen([shutil.which(lv["java"] + "w")] + args,**pkwargs)