From 2e6e13a67675bb60f7c6f279cd4812aa9c8860ab Mon Sep 17 00:00:00 2001 From: Charles Le Maux Date: Thu, 19 Sep 2024 12:24:56 +0200 Subject: [PATCH] [+] Updated modpack launch command Now the get_sdk_version won't be called on modded servers, preventing a non base 10 error (because the modpack's version name won't be represented as a minecraft version, but as the modpack name itself. --- server_mc_manager.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server_mc_manager.py b/server_mc_manager.py index 6aab6e9..1a37012 100644 --- a/server_mc_manager.py +++ b/server_mc_manager.py @@ -36,10 +36,12 @@ class MinecraftServerManager: " -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true" " -Dusing.aikars.flags=https://mcutils.com") - java: str = f"/usr/lib/jvm/java-{get_sdk_version(version)}-openjdk-amd64/bin/java" + command: str - command = f"{java} -Xmx{memory_size} {reg_flags} -jar {jar_file} --nogui" - if modded: + if not modded: + java: str = f"/usr/lib/jvm/java-{get_sdk_version(version)}-openjdk-amd64/bin/java" + command = f"{java} -Xmx{memory_size} {reg_flags} -jar {jar_file} --nogui" + else: command = "./start.sh" process = subprocess.Popen(shlex.split(command), cwd=server_directory, stdin=subprocess.PIPE)