arclight and another client tweak

This commit is contained in:
Joey Eamigh
2023-06-22 17:31:51 -04:00
parent 315746073d
commit f13458073e
3 changed files with 24 additions and 49 deletions

View File

@@ -13,8 +13,13 @@ FORGE_URL = (
FORGE_JAR = "forge-1.16.5-36.2.34.jar"
MODPACK_RELEASES_URL = "https://git.233hfd.com/api/v1/repos/joey/FishPogPixelmon/releases?limit=1"
ARCLIGHT_URL = "https://github.com/IzzelAliz/Arclight/releases/download/1.16%2F1.0.24/arclight-forge-1.16.5-1.0.24.jar"
ARCLIGHT_JAR = "arclight-forge-1.16.5-1.0.24.jar"
INSTANCE_DIR = os.path.join(str(os.getenv("HOME")), "pixelmon")
DELETION_EXEMPTED_MODS = ["TrainerCommands-1.16.5-2.6.0.jar", "spongeforge-1.16.5-36.2.5-8.1.0-RC1352-universal.jar"]
# main
def __main__():
@@ -23,6 +28,7 @@ def __main__():
if needs_mods:
mods()
forge()
arclight()
launch()
@@ -32,7 +38,20 @@ def launch():
exit(0)
os.chdir(f"{INSTANCE_DIR}/.minecraft")
subprocess.run(["java", "-Xmx30720M", "-Xms1024M", "-jar", FORGE_JAR, "--nogui"])
subprocess.run(["java", "-Xmx30720M", "-Xms1024M", "-jar", ARCLIGHT_JAR, "--nogui"])
# arclight
def arclight():
os.makedirs(f"{INSTANCE_DIR}/.minecraft", exist_ok=True)
os.chdir(f"{INSTANCE_DIR}/.minecraft")
if os.path.exists(os.path.join(f"{INSTANCE_DIR}/.minecraft", "arclight.jar")):
return
cprint("arclight.jar not found - downloading", "yellow")
r = requests.get(FORGE_URL, allow_redirects=True)
open("arclight.jar", "wb").write(r.content)
# forge
@@ -73,7 +92,7 @@ def mods():
subprocess.run(["java", "-jar", "downloader.jar", ".", "mods"], env=my_env)
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "mods", "*")):
if os.path.basename(file) == "TrainerCommands-1.16.5-2.6.0.jar":
if os.path.basename(file) in DELETION_EXEMPTED_MODS:
continue
os.remove(file)