forked from ByteExceptionM/laby-nbt-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
93 lines (79 loc) · 2.43 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
plugins {
id("java-library")
id("net.labymod.gradle")
id("net.labymod.gradle.addon")
}
group = "io.masel"
version = "1.5.0"
labyMod {
defaultPackageName = "io.masel.nbtviewer"
addonInfo {
namespace = "nbt-viewer"
displayName = "NBT Viewer"
author = "ByteException_"
description = "LabyMod addon to view item nbt data in minecraft. Enable Advanced Tooltips (F3+H), hover over an item and press SHIFT. Magic starts..."
minecraftVersion = "1.17.1<1.21"
version = System.getenv().getOrDefault("VERSION", "1.5.0")
}
minecraft {
registerVersions(
"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 = 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
}
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}