offline-minecraft-launcher/oml/stages/launch.py
2022-05-18 02:32:22 +02:00

14 lines
533 B
Python

print(colored(colorama.Fore.GREEN,"\nLaunching Minecraft..."))
if lv["console"] == "1":
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)
sys.exit(rtn)
else:
pkwargs = {
"stdout": subprocess.DEVNULL,
"stdin": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
}
if lv["osName"] == "windows": pkwargs["creationflags"] = 0x00000008
subprocess.Popen([shutil.which(lv["java"] + "w")] + args,**pkwargs)