CRITICAL FIX: relative path support

backup
LinuxMint4Ever 2019-08-05 14:58:44 +02:00
parent 7959384339
commit babf543f75
1 changed files with 7 additions and 1 deletions

View File

@ -107,10 +107,16 @@ def getToken(username, password):
return access_token, profile_id, username return access_token, profile_id, username
def deRelative(cwd, path):
if path[0]=='.':
return os.path.join(cwd, path)
else:
return path
def run(java_executable, ram, alignTo, libs, username, gameDir, assets, uuid, accessToken): def run(java_executable, ram, alignTo, libs, username, gameDir, assets, uuid, accessToken):
cwd = os.getcwd() cwd = os.getcwd()
os.chdir(gameDir) os.chdir(gameDir)
exitCode = os.system(java_executable+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(libs, "natives")+" -cp "+os.path.join(libs,"jar")+os.sep+(":"+os.path.join(libs,"jar")+os.sep).join(os.listdir(os.path.join(libs,"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+gameDir+" --assetsDir "+assets+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker") exitCode = os.system(deRelative(cwd, java_executable)+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(deRelative(cwd, libs), "natives")+" -cp "+os.path.join(deRelative(cwd, libs),"jar")+os.sep+(":"+os.path.join(deRelative(cwd,libs),"jar")+os.sep).join(os.listdir(os.path.join(deRelative(cwd, libs),"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+deRelative(cwd,gameDir)+" --assetsDir "+deRelative(cwd, assets)+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker")
os.chdir(cwd) os.chdir(cwd)
return exitCode return exitCode