-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
186 lines (157 loc) · 6.74 KB
/
build.gradle
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
buildscript {
repositories {
maven {
url = "https://maven.minecraftforge.net"
}
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
plugins {
id 'checkstyle'
id 'eclipse'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
apply plugin: 'net.minecraftforge.gradle'
version = project.mod_version
group = project.mod_group
archivesBaseName = project.mod_id
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
minecraft {
mappings channel: project.mappings_channel, version: project.mappings_version
runs {
client {
workingDirectory project.file('run')
// We don't do much with registries, let's let them be
//property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
// Load the necessary coremods.
// IMPORTANT: For some reasons, MIXIN adds CC as a reparseable core mod when it loads, which causes FML to not load the regular CC mod.
// A workaround to that is to trick MixinPlatformAgentFMLLegacy#isIgnoredReparseable(), either with a breakpoint, or with a symlink in the gradle cache directory
property 'fml.coreMods.load', 'io.github.opencubicchunks.cubicchunks.core.asm.coremod.CubicChunksCoreMod,io.github.opencubicchunks.cubicchunks.cubicgen.asm.coremod.CubicGenCoreMod'
property 'mixin.env.disableRefMap', 'true'
property 'terramap.debug', ''
property 'terramap.showTestScreen', 'false'
mods {
terramap {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'io.github.opencubicchunks.cubicchunks.core.asm.coremod.CubicChunksCoreMod,io.github.opencubicchunks.cubicchunks.cubicgen.asm.coremod.CubicGenCoreMod'
property 'mixin.env.disableRefMap', 'true'
property 'terramap.debug', ''
mods {
terramap {
source sourceSets.main
}
}
}
}
}
repositories {
maven {
name = "JitPack"
url = "https://jitpack.io/"
}
maven { //used for leveldb
name = "DaPorkchop_"
url = "https://maven.daporkchop.net/"
}
maven { //used for leveldb
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/snapshot/"
}
mavenCentral()
}
dependencies {
minecraft(group: "net.minecraftforge", name: "forge", version: project.minecraft_version + '-' + project.forge_version)
implementation group: "com.twelvemonkeys.imageio", name: "imageio-webp", version: project.twelvemonkeys_version
implementation fg.deobf(group: "com.github.OpenCubicChunks.CubicChunks", name: "cubicchunks", version: project.cc_version) {
transitive = false
}
implementation fg.deobf(group: "com.github.OpenCubicChunks", name: "CubicWorldGen", version: project.cwg_version) {
transitive = false
}
implementation fg.deobf(group: "com.github.BuildTheEarth", name: "terraplusplus", version: project.terrapp_version) {
transitive = true
}
// https://stackoverflow.com/questions/68377027/minecraft-forge-mod-loader-fml-loading-and-crashing-mc
implementation ("net.minecraftforge:mergetool:0.2.3.3") {
force = true
}
runtimeOnly group: "org.apache.commons", name: "commons-imaging", version: "1.0-alpha2"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter", version: "5.8.1"
testImplementation fg.deobf(group: "com.github.BuildTheEarth", name: "terraplusplus", version: project.terrapp_version)
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft_version
duplicatesStrategy = DuplicatesStrategy.INCLUDE
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft_version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
shadowJar {
dependencies {
include(dependency(group: "com.twelvemonkeys.common", name: "common-lang", version: project.twelvemonkeys_version))
include(dependency(group: "com.twelvemonkeys.common", name: "common-io", version: project.twelvemonkeys_version))
include(dependency(group: "com.twelvemonkeys.common", name: "common-image", version: project.twelvemonkeys_version))
include(dependency(group: "jmagick", name: "jmagick", version: project.jmagick_version))
include(dependency(group: "com.twelvemonkeys.imageio", name: "imageio-core", version: project.twelvemonkeys_version))
include(dependency(group: "com.twelvemonkeys.imageio", name: "imageio-metadata", version: project.twelvemonkeys_version))
include(dependency(group: "com.twelvemonkeys.imageio", name: "imageio-webp", version: project.twelvemonkeys_version))
}
archiveClassifier.set('')
finalizedBy('reobfJar')
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Specification-Title" : project.mod_id,
"Specification-Vendor" : project.mod_authors,
"Specification-Version" : project.mod_version,
"Implementation-Title" : project.mod_id,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : project.mod_authors,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
finalizedBy('shadowJar')
}
// If you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
test {
useJUnitPlatform()
}
legacy {
fixClasspath = true
}