diff options
author | Linnea Gräf <nea@nea.moe> | 2024-06-19 03:37:52 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-06-19 03:37:52 +0200 |
commit | 4b077b1a9c9a262cf730796f3876a86d6fa1064b (patch) | |
tree | a660180847b995d607949bc4e950876efdbc7cde /archenemyexample/src/forgeMain/kotlin | |
parent | 4d778b97ee33485af5236ad6bdfdd2949fd69cc2 (diff) | |
download | archenemy-master.tar.gz archenemy-master.tar.bz2 archenemy-master.zip |
Diffstat (limited to 'archenemyexample/src/forgeMain/kotlin')
-rw-r--r-- | archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt b/archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt index 141949e..827340d 100644 --- a/archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt +++ b/archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt @@ -5,7 +5,25 @@ import net.minecraft.launchwrapper.LaunchClassLoader import java.io.File class Tweaker : ITweaker { - override fun acceptOptions(args: MutableList<String>?, gameDir: File?, assetsDir: File?, profile: String?) { + val arguments = mutableListOf<String>() + + override fun acceptOptions( + args: List<String>, gameDir: File?, + assetsDir: File?, profile: String? + ) { + arguments.addAll(args) + if (gameDir != null){ + arguments.add("--gameDir") + arguments.add(gameDir.absolutePath) + } + if (assetsDir != null){ + arguments.add("--assetsDir") + arguments.add(assetsDir.absolutePath) + } + if (profile != null){ + arguments.add("--version") + arguments.add(profile) + } } override fun injectIntoClassLoader(classLoader: LaunchClassLoader) { @@ -16,6 +34,6 @@ class Tweaker : ITweaker { } override fun getLaunchArguments(): Array<String> { - return arrayOf() + return arguments.toTypedArray() } } |