From 47d4e6b5ded62177b797666e1b43f72ae8476d16 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 30 Mar 2021 06:24:13 +0200 Subject: [PATCH] Add basic custom profile support --- offline-minecraft-launcher.ini | 11 +++++++---- offline-minecraft-launcher.py | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/offline-minecraft-launcher.ini b/offline-minecraft-launcher.ini index 8c79dce..2c47849 100644 --- a/offline-minecraft-launcher.ini +++ b/offline-minecraft-launcher.ini @@ -1,17 +1,20 @@ [default] -# Set the path to the java executable. Don't add a file extension. +# Set the path to the java executable. Don't add a file extension java=java -# Set the arguments to launch minecraft with. Formatted in json. Use [] for none. +# Set the arguments to launch minecraft with. Formatted in json. Use [] for none jvmArguments=["-Xms128M","-Xmx800M"] -# Enable/disable console. +# Enable/disable console console=1 # Where is the game located? gamePath=$+sp$ -# Override the OS name. Choose windows, linux or macos, if the detection doesn't work right. +# Whether or not to make a profile folder, set to 1 to separate the data per player and version, set to 0 for compatibility +profileFolder=0 + +# Override the OS name. Choose windows, linux or macos, if the detection doesn't work right osName= # Override OS version diff --git a/offline-minecraft-launcher.py b/offline-minecraft-launcher.py index 5cacfae..7b1a62a 100644 --- a/offline-minecraft-launcher.py +++ b/offline-minecraft-launcher.py @@ -332,6 +332,12 @@ def main(): launcherVariables["launcher_version"] = "0.0" launcherVariables["classpath"] = libraryList + if lv["profileFolder"] == "1": + profilePath = p(lv["gamePath"],"profiles") + launcherVariables["game_directory"] = p(profilePath,lv["name"],lv["version"]) + if not os.path.isdir(launcherVariables["game_directory"]): os.makedirs(launcherVariables["game_directory"]) + os.chdir(launcherVariables["game_directory"]) + # legacy: launcherVariables["game_assets"] = assetsPath launcherVariables["auth_session"] = "-"