1
1
buildscript {
2
2
repositories {
3
3
maven { url = ' https://maven.minecraftforge.net/' }
4
- maven { url = ' https://repo.spongepowered.org/maven' }
5
- mavenCentral()
6
4
}
7
5
dependencies {
8
- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
9
6
classpath ' org.spongepowered:mixingradle:0.7.+'
10
7
}
11
8
}
@@ -14,14 +11,13 @@ plugins {
14
11
id ' java'
15
12
id ' maven-publish'
16
13
id ' com.github.johnrengelman.shadow' version ' 7.1.2'
14
+ id ' net.minecraftforge.gradle' version ' 5.1.+'
15
+ id ' org.parchmentmc.librarian.forgegradle' version ' 1.+'
16
+ id ' org.spongepowered.mixin' version ' 0.7.+'
17
17
}
18
- apply plugin : ' net.minecraftforge.gradle'
19
- // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
20
- apply plugin : ' org.spongepowered.mixin'
21
18
22
19
version = project. mod_version
23
20
group = project. maven_group
24
- archivesBaseName = " ${ project.archives_base_name} -${ project.minecraft_version} "
25
21
26
22
repositories {
27
23
maven {
@@ -69,7 +65,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(17)
69
65
println (' Java: ' + System . getProperty(' java.version' ) + ' JVM: ' + System . getProperty(' java.vm.version' ) + ' (' + System . getProperty(' java.vendor' ) + ' ) Arch: ' + System . getProperty(' os.arch' ))
70
66
71
67
minecraft {
72
- mappings channel : ' official ' , version : snapshot
68
+ mappings channel : mappings_channel , version : mappings_version
73
69
74
70
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
75
71
accessTransformer = file(' src/main/resources/META-INF/accesstransformer.cfg' )
@@ -88,11 +84,6 @@ minecraft {
88
84
// Recommended logging level for the console
89
85
property ' forge.logging.console.level' , ' debug'
90
86
91
- // args '--mixin', 'mixins.dsurround.json'
92
- // args '--mixin', 'mixins.sndctrl.json'
93
- // args '--mixin', 'mixins.mobeffects.json'
94
- // args '--mixin', 'mixins.environs.json'
95
-
96
87
mods {
97
88
dsurround {
98
89
source sourceSets. main
@@ -160,45 +151,20 @@ dependencies {
160
151
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
161
152
minecraft " net.minecraftforge:forge:${ minecraft_version} -${ forge_version} "
162
153
163
- annotationProcessor ' org.spongepowered:mixin:0.8.4:processor'
164
-
165
- // You may put jars on which you depend on in ./libs or you may define them like so..
166
- // compile "some.group:artifact:version:classifier"
167
- // compile "some.group:artifact:version"
168
-
169
- // Real examples
170
- // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
171
- // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
172
-
173
- // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
174
- // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
154
+ annotationProcessor " org.spongepowered:mixin:${ mixin_version} :processor"
175
155
176
- // These dependencies get remapped to your current MCP mappings
177
- // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
156
+ // implementation fg.deobf("curse.maven:SereneSeasons-291874:3621343")
157
+ implementation fg . deobf( " me.shedaniel.cloth:cloth-config-forge: ${ cloth_config_version } " )
178
158
179
- // For more info...
180
- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
181
- // http://www.gradle.org/docs/current/userguide/dependency_management.html
182
-
183
- implementation fg. deobf(" curse.maven:SereneSeasons-291874:3621343" )
184
- implementation fg. deobf(" curse.maven:clothAPI-348521:3641133" )
185
-
186
- runtimeOnly fg. deobf(" curse.maven:jei-238222:3723162" )
187
- runtimeOnly fg. deobf(" curse.maven:TheOneProbe-245211:3665852" )
159
+ runtimeOnly fg. deobf(" curse.maven:jei-238222:${ jei_file_id} " )
160
+ runtimeOnly fg. deobf(" curse.maven:the-one-probe-245211:${ the_one_probe_file_id} " )
188
161
189
162
// Capability Syncer
190
163
shadow fg. deobf(" dev._100media.capabilitysyncer:capabilitysyncer:${ capabilitysyncer_version} " )
191
164
}
192
165
193
- processResources {
194
- duplicatesStrategy = DuplicatesStrategy . FAIL
195
- filesMatching(" META-INF/mods.toml" ) {
196
- expand ' version' : project. version
197
- }
198
- }
199
-
200
166
jar {
201
-
167
+ archiveClassifier = ' slim '
202
168
from(configurations. embed. collect { it. isDirectory() ? it : zipTree(it) }) {
203
169
exclude " LICENSE.txt" , " META-INF/MANIFSET.MF" , " META-INF/maven/**" , " META-INF/*.RSA" , " META-INF/*.SF"
204
170
}
@@ -210,17 +176,15 @@ jar {
210
176
211
177
manifest {
212
178
attributes([
213
- // "MixinConfigs": "mixins.dsurround.json,mixins.sndctrl.json,mixins.mobeffects.json,mixins.environs.json",
214
179
" Specification-Title" : " ${ mod_id} " ,
215
180
" Specification-Vendor" : " OreCruncher" ,
216
181
" Specification-Version" : " 1" , // We are version 1 of ourselves
217
182
" Implementation-Title" : project. name,
218
- " Implementation-Version" : " ${ version} " ,
183
+ " Implementation-Version" : project . version,
219
184
" Implementation-Vendor" : " OreCruncher" ,
220
185
" Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
221
186
])
222
187
}
223
-
224
188
}
225
189
226
190
def relocateTargets = [' dev._100media.capabilitysyncer' ]
@@ -233,9 +197,7 @@ shadowJar {
233
197
finalizedBy ' reobfShadowJar'
234
198
}
235
199
236
- artifacts {
237
- shadowJar
238
- }
200
+ assemble. dependsOn shadowJar
239
201
240
202
reobf {
241
203
shadowJar {}
@@ -252,6 +214,10 @@ jar.finalizedBy('reobfJar')
252
214
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
253
215
// publish.dependsOn('reobfJar')
254
216
217
+ tasks. withType(JavaCompile ). configureEach {
218
+ options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
219
+ }
220
+
255
221
publishing {
256
222
publications {
257
223
mavenJava(MavenPublication ) {
0 commit comments