diff options
Diffstat (limited to 'archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge')
-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() } } |