generated from LabyMod/addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
98 lines (84 loc) · 2.56 KB
/
build.gradle.kts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
plugins {
id("java-library")
id("net.labymod.gradle")
id("net.labymod.gradle.addon")
}
group = "org.example"
version = System.getenv().getOrDefault("VERSION", "1.0.6")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
labyMod {
defaultPackageName = "com.rappytv.headowner" //change this to your main package name (used by all modules)
addonInfo {
namespace = "headowner"
displayName = "Head Owner"
author = "RappyTV"
description = "Shows the owner or head type of the head you're looking at"
minecraftVersion = "1.8<1.21"
version = getVersion().toString()
}
minecraft {
registerVersions(
"1.8.9",
"1.12.2",
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.2",
"1.19.3",
"1.19.4",
"1.20.1",
"1.20.2",
"1.20.4",
"1.20.5",
"1.20.6",
"1.21"
) { version, provider ->
configureRun(provider, version)
}
subprojects.forEach {
if (it.name != "game-runner") {
filter(it.name)
}
}
}
addonDev {
productionRelease()
}
}
subprojects {
plugins.apply("java-library")
plugins.apply("net.labymod.gradle")
plugins.apply("net.labymod.gradle.addon")
repositories {
maven("https://libraries.minecraft.net/")
maven("https://repo.spongepowered.org/repository/maven-public/")
}
}
fun configureRun(provider: net.labymod.gradle.core.minecraft.provider.VersionProvider, gameVersion: String) {
provider.runConfiguration {
mainClass = "net.minecraft.launchwrapper.Launch"
jvmArgs("-Dnet.labymod.running-version=${gameVersion}")
jvmArgs("-Dmixin.debug=true")
jvmArgs("-Dnet.labymod.debugging.all=true")
jvmArgs("-Dmixin.env.disableRefMap=true")
args("--tweakClass", "net.labymod.core.loader.vanilla.launchwrapper.LabyModLaunchWrapperTweaker")
args("--labymod-dev-environment", "true")
args("--addon-dev-environment", "true")
}
provider.javaVersion = when (gameVersion) {
else -> {
JavaVersion.VERSION_21
}
}
provider.mixin {
val mixinMinVersion = when (gameVersion) {
"1.8.9", "1.12.2", "1.16.5" -> {
"0.6.6"
}
else -> {
"0.8.2"
}
}
minVersion = mixinMinVersion
}
}