-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.gradle.kts
132 lines (105 loc) · 3.79 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
plugins {
id("java")
id("idea")
id("com.matthewprenger.cursegradle") version "1.4.0"
id("net.minecraftforge.gradle") version "[6.0,6.2)"
id("org.parchmentmc.librarian.forgegradle") version "1.+"
id("org.spongepowered.mixin") version "0.7.+"
}
val minecraftVersion: String = "1.20.1"
// Don't bump this unless completely necessary - this is the NeoForge + Forge compatible version
// In future we probably want to track NeoForge versions, especially post-1.20 breaking change window
val forgeVersion: String = "47.1.3"
val mixinVersion: String = "0.8.5"
val modVersion: String = System.getenv("VERSION") ?: "0.0.0-indev"
val jeiVersion: String = "15.2.0.21"
val patchouliVersion: String = "1.20.1-81-FORGE"
val jadeVersion: String = "4614153"
val topVersion: String = "4629624"
val tfcVersion: String = "5872631"
val modId: String = "firmalife"
base {
archivesName.set("Firmalife-$minecraftVersion")
group = "com.eerussianguy.firmalife"
version = modVersion
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
idea {
module {
excludeDirs.add(file("run"))
}
}
repositories {
mavenCentral()
mavenLocal()
maven(url = "https://dvs1.progwml6.com/files/maven/") // JEI
maven(url = "https://modmaven.k-4u.nl") // Mirror for JEI
maven(url = "https://maven.blamejared.com") // Patchouli
maven(url = "https://www.cursemaven.com") {
content {
includeGroup("curse.maven")
}
}
flatDir {
dirs("libs")
}
}
dependencies {
minecraft("net.minecraftforge", "forge", version = "$minecraftVersion-$forgeVersion")
// TFC
implementation(fg.deobf("curse.maven:tfc-302973:${tfcVersion}"))
// implementation(fg.deobf("tfc:TerraFirmaCraft-Forge-1.20.1:0.0.0-indev"))
// JEI
compileOnly(fg.deobf("mezz.jei:jei-$minecraftVersion-forge-api:$jeiVersion"))
compileOnly(fg.deobf("mezz.jei:jei-$minecraftVersion-common-api:$jeiVersion"))
runtimeOnly(fg.deobf("mezz.jei:jei-$minecraftVersion-forge:$jeiVersion"))
// Patchouli
// We need to compile against the full JAR, not just the API, because we do some egregious hacks.
compileOnly(fg.deobf("vazkii.patchouli:Patchouli:$patchouliVersion"))
runtimeOnly(fg.deobf("vazkii.patchouli:Patchouli:$patchouliVersion"))
// Jade / The One Probe
compileOnly(fg.deobf("curse.maven:jade-324717:${jadeVersion}"))
compileOnly(fg.deobf("curse.maven:top-245211:${topVersion}"))
// Only use Jade at runtime
runtimeOnly(fg.deobf("curse.maven:jade-324717:${jadeVersion}"))
if (System.getProperty("idea.sync.active") != "true") {
annotationProcessor("org.spongepowered:mixin:${mixinVersion}:processor")
}
}
minecraft {
mappings("parchment", "2023.09.03-1.20.1")
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
runs {
all {
args("-mixin.config=$modId.mixins.json")
property("forge.logging.console.level", "debug")
property("mixin.env.remapRefMap", "true")
property("mixin.env.refMapRemappingFile", "$projectDir/build/createSrgToMcp/output.srg")
jvmArgs("-ea", "-Xmx4G", "-Xms4G")
jvmArg("-XX:+AllowEnhancedClassRedefinition")
mods.create(modId) {
source(sourceSets.main.get())
}
}
register("client") {
workingDirectory(project.file("run/client"))
}
register("server") {
workingDirectory(project.file("run/server"))
arg("--nogui")
}
}
}
mixin {
add(sourceSets.main.get(), "firmalife.refmap.json")
}
tasks {
jar {
manifest {
attributes["Implementation-Version"] = project.version
attributes["MixinConfigs"] = "$modId.mixins.json"
}
}
}