Skip to content

Instantly share code, notes, and snippets.

@kb-1000
Created November 28, 2018 16:15
Show Gist options
  • Save kb-1000/7bbb9cead65926938a98fcfc61382674 to your computer and use it in GitHub Desktop.
Save kb-1000/7bbb9cead65926938a98fcfc61382674 to your computer and use it in GitHub Desktop.
#!/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