summaryrefslogtreecommitdiff
path: root/archenemyexample/src/forgeMain/kotlin
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-06-19 03:37:52 +0200
committerLinnea Gräf <nea@nea.moe>2024-06-19 03:37:52 +0200
commit4b077b1a9c9a262cf730796f3876a86d6fa1064b (patch)
treea660180847b995d607949bc4e950876efdbc7cde /archenemyexample/src/forgeMain/kotlin
parent4d778b97ee33485af5236ad6bdfdd2949fd69cc2 (diff)
downloadarchenemy-master.tar.gz
archenemy-master.tar.bz2
archenemy-master.zip
Add more code to make the client run workHEADmaster
Diffstat (limited to 'archenemyexample/src/forgeMain/kotlin')
-rw-r--r--archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt22
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()
}
}