1
1
buildscript {
2
2
repositories {
3
- maven { url = ' https://files.minecraftforge.net/maven' }
3
+ maven { url ' https://maven.minecraftforge.net' }
4
+ maven { url ' https://maven.parchmentmc.org' }
5
+ // maven { url 'https://repo.spongepowered.org/repository/maven-public/' }
4
6
mavenCentral()
5
7
maven {
6
8
name = " sonatype"
@@ -9,16 +11,21 @@ buildscript {
9
11
maven {
10
12
url " https://plugins.gradle.org/m2/"
11
13
}
12
- // maven { url='https://repo.spongepowered.org/repository/maven-public/' }
13
14
}
14
15
dependencies {
15
- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 4.1.+' , changing : true
16
- classpath " io.freefair.gradle:lombok-plugin:4.+"
16
+ classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
17
+ classpath ' org.parchmentmc:librarian:1.+'
18
+ classpath ' io.freefair.gradle:lombok-plugin:6.3.0'
17
19
// classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
18
20
}
19
21
}
20
- apply plugin : ' net.minecraftforge.gradle'
21
22
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
23
+ plugins {
24
+ id ' eclipse'
25
+ id ' maven-publish'
26
+ }
27
+ apply plugin : ' net.minecraftforge.gradle'
28
+ apply plugin : ' org.parchmentmc.librarian.forgegradle'
22
29
apply plugin : ' eclipse'
23
30
apply plugin : ' maven-publish'
24
31
apply plugin : " io.freefair.lombok"
@@ -32,9 +39,10 @@ version = mod_version
32
39
group = ' com.rcx.materialis' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
33
40
archivesBaseName = ' materialis'
34
41
35
- java. toolchain. languageVersion = JavaLanguageVersion . of(8 ) // Mojang ships Java 8 to end users, so your mod should target Java 8.
42
+ // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
43
+ java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
36
44
37
- println ( ' Java: ' + System . getProperty( ' java.version' ) + ' JVM: ' + System . getProperty( ' java.vm.version' ) + ' ( ' + System . getProperty( ' java.vendor' ) + ' ) Arch: ' + System . getProperty( ' os.arch' ))
45
+ println " Java: ${ System.getProperty 'java.version'} , JVM: ${ System.getProperty 'java.vm.version'} ( ${ System.getProperty 'java.vendor'} ), Arch: ${ System.getProperty 'os.arch'} "
38
46
minecraft {
39
47
// The mappings can be changed at any time, and must be in the following format.
40
48
// Channel: Version:
@@ -47,7 +55,7 @@ minecraft {
47
55
//
48
56
// Use non-default mappings at your own risk. they may not always work.
49
57
// Simply re-run your setup task after changing the mappings to update your workspace.
50
- mappings channel : ' official ' , version : ' 1.16.5 '
58
+ mappings channel : ' parchment ' , version : " ${ mappings_version } - ${ minecraft_version } "
51
59
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
52
60
53
61
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -57,10 +65,9 @@ minecraft {
57
65
runs {
58
66
client {
59
67
workingDirectory project. file(' run' )
60
- jvmArgs " -Dmixin.env.disableRefMap=true"
61
68
62
69
// Recommended logging data for a userdev environment
63
- // The markers can be changed as needed.
70
+ // The markers can be added/remove as needed separated by commas.
64
71
// "SCAN": For mods scan.
65
72
// "REGISTRIES": For firing of registry events.
66
73
// "REGISTRYDUMP": For getting the contents of all registries.
@@ -71,6 +78,9 @@ minecraft {
71
78
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
72
79
property ' forge.logging.console.level' , ' debug'
73
80
81
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
82
+ property ' forge.enabledGameTestNamespaces' , ' materialis'
83
+
74
84
mods {
75
85
materialis {
76
86
source sourceSets. main
@@ -80,10 +90,29 @@ minecraft {
80
90
81
91
server {
82
92
workingDirectory project. file(' run' )
83
- jvmArgs " -Dmixin.env.disableRefMap=true"
93
+
94
+ property ' forge.logging.markers' , ' REGISTRIES'
95
+
96
+ property ' forge.logging.console.level' , ' debug'
97
+
98
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
99
+ property ' forge.enabledGameTestNamespaces' , ' materialis'
100
+
101
+ mods {
102
+ materialis {
103
+ source sourceSets. main
104
+ }
105
+ }
106
+ }
107
+
108
+ // This run config launches GameTestServer and runs all registered gametests, then exits.
109
+ // By default, the server will crash when no gametests are provided.
110
+ // The gametest system is also enabled by default for other run configs under the /test command.
111
+ gameTestServer {
112
+ workingDirectory project. file(' run' )
84
113
85
114
// Recommended logging data for a userdev environment
86
- // The markers can be changed as needed.
115
+ // The markers can be added/remove as needed separated by commas.
87
116
// "SCAN": For mods scan.
88
117
// "REGISTRIES": For firing of registry events.
89
118
// "REGISTRYDUMP": For getting the contents of all registries.
@@ -94,6 +123,9 @@ minecraft {
94
123
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
95
124
property ' forge.logging.console.level' , ' debug'
96
125
126
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
127
+ property ' forge.enabledGameTestNamespaces' , ' materialis'
128
+
97
129
mods {
98
130
materialis {
99
131
source sourceSets. main
@@ -103,18 +135,9 @@ minecraft {
103
135
104
136
data {
105
137
workingDirectory project. file(' run' )
106
- jvmArgs " -Dmixin.env.disableRefMap=true"
107
138
108
- // Recommended logging data for a userdev environment
109
- // The markers can be changed as needed.
110
- // "SCAN": For mods scan.
111
- // "REGISTRIES": For firing of registry events.
112
- // "REGISTRYDUMP": For getting the contents of all registries.
113
139
property ' forge.logging.markers' , ' REGISTRIES'
114
140
115
- // Recommended logging level for the console
116
- // You can set various levels here.
117
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
118
141
property ' forge.logging.console.level' , ' debug'
119
142
120
143
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
@@ -132,31 +155,54 @@ minecraft {
132
155
// Include resources generated by data generators.
133
156
sourceSets. main. resources { srcDir ' src/generated/resources' }
134
157
158
+ repositories {
159
+ mavenLocal()
160
+ maven { // SlimeKnights and JEI
161
+ name ' DVS1 Maven FS'
162
+ url ' https://dvs1.progwml6.com/files/maven'
163
+ }
164
+ maven { // TOP
165
+ name ' tterrag maven'
166
+ url " https://maven.tterrag.com/"
167
+ }
168
+ maven {
169
+ name = " CurseMaven"
170
+ url = " https://www.cursemaven.com/"
171
+ content {
172
+ includeGroup " curse.maven"
173
+ }
174
+ }
175
+ maven { // Psi & botania
176
+ name = " jared maven"
177
+ url = " https://maven.blamejared.com/"
178
+ }
179
+ }
180
+
135
181
dependencies {
136
182
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
137
183
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
138
184
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
139
- minecraft " net.minecraftforge:forge:1.16.5 -${ forge_version} "
185
+ minecraft " net.minecraftforge:forge:${ minecraft_version } -${ forge_version} "
140
186
141
187
// Copypasted from tinkers energistics. No shame whatsoever.
142
- compile fg. deobf(" slimeknights.tconstruct:TConstruct:${ minecraft_version } -${ tcon_version} " )
143
- compile fg. deobf(" slimeknights.mantle:Mantle:${ minecraft_version } -${ mantle_version} " )
188
+ implementation fg. deobf(" slimeknights.tconstruct:TConstruct:1.18.1 -${ tcon_version} " )
189
+ implementation fg. deobf(" slimeknights.mantle:Mantle:1.18.1 -${ mantle_version} " )
144
190
145
- compileOnly fg. deobf(" mezz.jei:jei-${ jei_version} :api" )
146
- runtimeOnly fg. deobf(" mezz.jei:jei-${ jei_version} " )
191
+ compileOnly fg. deobf(" mezz.jei:jei-${ minecraft_version } : ${ jei_version} :api" )
192
+ runtimeOnly fg. deobf(" mezz.jei:jei-${ minecraft_version } : ${ jei_version} " )
147
193
148
- compileOnly fg. deobf(" curse.maven:eidolon-429625:3157832" )
149
- compileOnly fg. deobf(" curse.maven:curios-309927:3456953 " )
150
- compileOnly fg. deobf(" vazkii.psi:Psi:${ psi_version} " )
151
- compileOnly fg. deobf(" curse.maven:magipsi-396405:3388248" )
194
+ // compileOnly fg.deobf("curse.maven:eidolon-429625:3157832")
195
+ compileOnly fg. deobf(" curse.maven:curios-309927:3661868 " )
196
+ // compileOnly fg.deobf("vazkii.psi:Psi:${psi_version}")
197
+ // compileOnly fg.deobf("curse.maven:magipsi-396405:3388248")
152
198
compileOnly fg. deobf(" vazkii.botania:Botania:${ botania_version} " )
153
- compileOnly fg. deobf(" curse.maven:quark-243121:3490981 " )
154
- compileOnly fg. deobf(" curse.maven:arl-250363:3326041 " )
155
- compileOnly fg. deobf(" curse.maven:thermal-222880:3412300" )
156
- compileOnly fg. deobf(" curse.maven:cofhcore-69162:3407019" )
157
- compileOnly fg. deobf(" curse.maven:create-328085:3499718 " )
158
- compileOnly fg. deobf(" curse.maven:immersiveengineering-231951:3497359 " )
159
- compileOnly fg. deobf(" curse.maven:prettypipes-376737:3472990 " )
199
+ compileOnly fg. deobf(" curse.maven:quark-243121:3662309 " )
200
+ compileOnly fg. deobf(" curse.maven:arl-250363:3642382 " )
201
+ // compileOnly fg.deobf("curse.maven:thermal-222880:3412300")
202
+ // compileOnly fg.deobf("curse.maven:cofhcore-69162:3407019")
203
+ compileOnly fg. deobf(" curse.maven:create-328085:3687358 " )
204
+ compileOnly fg. deobf(" curse.maven:immersiveengineering-231951:3587149 " )
205
+ compileOnly fg. deobf(" curse.maven:prettypipes-376737:3645314 " )
160
206
161
207
// annotationProcessor 'org.spongepowered:mixin:0.1.2-SNAPSHOT:processor'
162
208
@@ -180,81 +226,6 @@ dependencies {
180
226
181
227
}
182
228
183
- repositories {
184
- mavenLocal()
185
- maven { // Forge
186
- name ' ForgeFS'
187
- url ' https://files.minecraftforge.net/maven'
188
- }
189
- maven { // SlimeKnights and JEI
190
- name ' DVS1 Maven FS'
191
- url ' https://dvs1.progwml6.com/files/maven'
192
- }
193
- maven { // TOP
194
- name ' tterrag maven'
195
- url " https://maven.tterrag.com/"
196
- }
197
- maven {
198
- name = " CurseMaven"
199
- url = " https://www.cursemaven.com/"
200
- }
201
- maven { // Psi & botania
202
- name = " jared maven"
203
- url = " https://maven.blamejared.com/"
204
- }
205
- }
206
-
207
- ext. artifact_version = ' NFG'
208
- if (System . getenv(). ARTIFACT_VERSION == null ) {
209
- artifact_version = " ${ mod_version} "
210
- }
211
- if (System . getenv(). ARTIFACT_VERSION != null ) {
212
- artifact_version = " ${ system.getenv().ARTIFACT_VERSION} "
213
- }
214
-
215
- def modsTomlSpec = copySpec{
216
- from(sourceSets. main. resources) {
217
- include ' META-INF/mods.toml'
218
- expand ' version' : artifact_version,
219
- ' loader_range' : loader_range,
220
- ' minecraft_range' : minecraft_range,
221
- ' forge_range' : forge_range,
222
- ' mantle_range' : mantle_range,
223
- ' tconstruct_range' : tconstruct_range
224
- }
225
- }
226
-
227
- def buildPaths = [
228
- " $rootDir /out/production/resources" , // IDEA
229
- " $rootDir /bin" , // Eclipse
230
- ]
231
-
232
- /* task replaceResources {
233
- // ensure directory exists, first build likes to fail
234
- new File("${processResources.destinationDir}/META-INF").mkdirs()
235
- // copy for gradle
236
- copy {
237
- outputs.upToDateWhen { false }
238
- with modsTomlSpec
239
- into processResources.destinationDir
240
- }
241
- // copy for IDEs
242
- buildPaths.each { path ->
243
- if (new File(path).exists()) {
244
- copy {
245
- outputs.upToDateWhen { false }
246
- with modsTomlSpec
247
- into path
248
- }
249
- }
250
- }
251
- }
252
-
253
- processResources {
254
- exclude 'META-INF/mods.toml'
255
- finalizedBy replaceResources
256
- }*/
257
-
258
229
// Example for how to get properties into the manifest for reading by the runtime..
259
230
jar {
260
231
manifest {
@@ -270,11 +241,11 @@ jar {
270
241
}
271
242
}
272
243
273
- // Example configuration to allow publishing using the maven-publish task
244
+ // Example configuration to allow publishing using the maven-publish plugin
274
245
// This is the preferred method to reobfuscate your jar file
275
- jar. finalizedBy(' reobfJar' )
246
+ jar. finalizedBy(' reobfJar' )
276
247
// 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
277
- // publish.dependsOn('reobfJar')
248
+ // publish.dependsOn('reobfJar')
278
249
279
250
publishing {
280
251
publications {
@@ -284,7 +255,11 @@ publishing {
284
255
}
285
256
repositories {
286
257
maven {
287
- url " file:/// ${ project.projectDir} /mcmodsrepo"
258
+ url " file://${ project.projectDir} /mcmodsrepo"
288
259
}
289
260
}
290
261
}
262
+
263
+ tasks. withType(JavaCompile ). configureEach {
264
+ options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
265
+ }
0 commit comments