generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 10
/
stonecutter.gradle.kts
48 lines (43 loc) · 1.79 KB
/
stonecutter.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
plugins {
id("dev.kikugie.stonecutter")
kotlin("jvm") version "2.0.0" apply false
kotlin("plugin.serialization") version "2.0.0" apply false
id("co.uzzu.dotenv.gradle") version "4.0.0"
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
id("me.modmuss50.mod-publish-plugin") version "0.5.+" apply false
}
stonecutter active "1.20.1-fabric" /* [SC] DO NOT EDIT */
stonecutter registerChiseled tasks.register("chiseledBuildAndCollect", stonecutter.chiseled) {
group = "project"
ofTask("buildAndCollect")
}
stonecutter registerChiseled tasks.register("chiseledPublishMods", stonecutter.chiseled) {
group = "project"
ofTask("publishMods")
}
stonecutter configureEach {
val data = current.project.split('-')
val platforms = listOf("fabric", "forge", "neoforge")
.map { it to (it == data[1]) }
consts(platforms)
swap("mc", "\"${data[0]}\"")
val is21 = eval(current.version, ">=1.21")
val oldRender = """
operation.call(model, matrices, vertices, light, overlay, red, green, blue, alpha);
ElytraTrimsAPI.renderFeatures(model, matrices, provider, entity, stack, light, red, green, blue, alpha);
""".trimIndent().prependIndent(" ")
swap("render_call") {
if (is21) """
operation.call(model, matrices, vertices, light, overlay);
ElytraTrimsAPI.renderFeatures(model, matrices, provider, entity, stack, light, -1);
""".trimIndent().prependIndent(" ")
else oldRender
}
swap("render_call_color") {
if (is21) """
operation.call(model, matrices, vertices, light, overlay, color);
ElytraTrimsAPI.renderFeatures(model, matrices, provider, entity, stack, light, color);
""".trimIndent().prependIndent(" ")
else oldRender
}
}