summaryrefslogtreecommitdiff
path: root/archenemyexample/src/forgeMain/kotlin/moe/nea/aee/forge/Main.kt
blob: 827340dbd45ca1aac61c9cc8ef07e52d7726b7e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package moe.nea.aee.forge

import net.minecraft.launchwrapper.ITweaker
import net.minecraft.launchwrapper.LaunchClassLoader
import java.io.File

class Tweaker : ITweaker {
	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) {
	}

	override fun getLaunchTarget(): String {
		return "net.minecraft.client.main.Main"
	}

	override fun getLaunchArguments(): Array<String> {
		return arguments.toTypedArray()
	}
}