Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python3
import os
import urllib.request
import zipfile
if not os.path.isdir("forge-1.12.2-14.23.5.2768-mdk"):
if not os.path.isfile("forge-1.12.2-14.23.5.2768-mdk.zip"):
with urllib.urlopen("http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12.2-14.23.5.2768/forge-1.12.2-14.23.5.2768-mdk.zip") as conn, open("forge-1.12.2-14.23.5.2768-mdk.zip", "wb") as fp:
fp.write(conn.read())
with zipfile.ZipFile("forge-1.12.2-14.23.5.2768-mdk.zip", "r") as zf:
zf.extractall("forge-1.12.2-14.23.5.2768-mdk")
os.chdir("forge-1.12.2-14.23.5.2768-mdk")
if os.path.isfile("gradle.properties"):
os.unlink("gradle.properties")
# The following will stop if memory overflows
os.system(os.path.join(os.environ["JAVA_HOME"], "bin", "java") + " -cp " + os.path.join("gradle", "wrapper", "gradle-wrapper.jar") + " org.gradle.wrapper.GradleWrapperMain --no-daemon runClient") # Yes, os.system is bad style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment