1
- // version: 1656003793falsepattern44
1
+ // version: 1656003793falsepattern51
2
2
/*
3
3
DO NOT CHANGE THIS FILE!
4
4
@@ -124,7 +124,9 @@ propertyDefaultIfUnset("repositoryName", "")
124
124
propertyDefaultIfUnset(" mavenGroupId" , " " )
125
125
propertyDefaultIfUnset(" mavenArtifactId" , " " )
126
126
propertyDefaultIfUnset(" hasMixinDeps" , false )
127
- propertyDefaultIfUnset(" mixinPreinitConfig" , " " )
127
+ propertyDefaultIfUnset(" mixinConfigs" , " " )
128
+ propertyDefaultIfUnset(" mixinPluginPreInit" , " " )
129
+ propertyDefaultIfUnset(" mixinPluginMinimumVersion" , " 0.8.5" )
128
130
propertyDefaultIfUnset(" remapStubs" , false )
129
131
130
132
propertyDefaultIfUnset(" modrinthProjectId" , " " )
@@ -165,8 +167,8 @@ if(accessTransformersFile) {
165
167
}
166
168
167
169
if (usesMixins. toBoolean()) {
168
- if (mixinsPackage. isEmpty() || mixinPlugin . isEmpty() ) {
169
- throw new GradleException (" \" mixinPlugin \" requires \" mixinsPackage\" and \" mixinPlugin \" to be set!" )
170
+ if (mixinsPackage. isEmpty()) {
171
+ throw new GradleException (" \" usesMixins \" requires \" mixinsPackage\" to be set!" )
170
172
}
171
173
172
174
targetPackageJava = javaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinsPackage. toString(). replaceAll(" \\ ." , " /" )
@@ -176,12 +178,14 @@ if(usesMixins.toBoolean()) {
176
178
throw new GradleException (" Could not resolve \" mixinsPackage\" ! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
177
179
}
178
180
179
- String targetFileJava = javaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .java"
180
- String targetFileScala = scalaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .scala"
181
- String targetFileScalaJava = scalaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .java"
182
- String targetFileKotlin = kotlinSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .kt"
183
- if (! (getFile(targetFileJava). exists() || getFile(targetFileScala). exists() || getFile(targetFileScalaJava). exists() || getFile(targetFileKotlin). exists())) {
184
- throw new GradleException (" Could not resolve \" mixinPlugin\" ! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
181
+ if (! mixinPlugin. isEmpty()) {
182
+ String targetFileJava = javaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .java"
183
+ String targetFileScala = scalaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .scala"
184
+ String targetFileScalaJava = scalaSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .java"
185
+ String targetFileKotlin = kotlinSourceDir + modGroup. toString(). replaceAll(" \\ ." , " /" ) + " /" + mixinPlugin. toString(). replaceAll(" \\ ." , " /" ) + " .kt"
186
+ if (! (getFile(targetFileJava). exists() || getFile(targetFileScala). exists() || getFile(targetFileScalaJava). exists() || getFile(targetFileKotlin). exists())) {
187
+ throw new GradleException (" Could not resolve \" mixinPlugin\" ! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
188
+ }
185
189
}
186
190
}
187
191
@@ -299,15 +303,15 @@ dependencies {
299
303
annotationProcessor(" org.ow2.asm:asm-debug-all:5.0.3" )
300
304
annotationProcessor(" com.google.guava:guava:24.1.1-jre" )
301
305
annotationProcessor(" com.google.code.gson:gson:2.8.6" )
302
- annotationProcessor(" org.spongepowered:mixin:0.8.3-gasstation" )
303
306
annotationProcessor(" com.llamalad7:MixinExtras:0.0.12-gasstation" )
304
- compile(" org.spongepowered:mixin:0.8.3-gasstation" )
307
+ annotationProcessor(" org.spongepowered:mixin:0.8.5-gasstation_3" )
308
+ compile(" org.spongepowered:mixin:0.8.5-gasstation_3" )
305
309
compile(" com.llamalad7:MixinExtras:0.0.12-gasstation" )
306
- compile(" com.falsepattern:00gasstation-mc1.7.10:0.2.1 :dev" )
310
+ compile(" com.falsepattern:00gasstation-mc1.7.10:0.3.4 :dev" )
307
311
} else if (hasMixinDeps. toBoolean()) {
308
- runtime(" org.spongepowered:mixin:0.8.3-gasstation " )
312
+ runtime(" org.spongepowered:mixin:0.8.5-gasstation_3 " )
309
313
runtime(" com.llamalad7:MixinExtras:0.0.12-gasstation" )
310
- runtime(" com.falsepattern:00gasstation-mc1.7.10:0.2.1 :dev" )
314
+ runtime(" com.falsepattern:00gasstation-mc1.7.10:0.3.4 :dev" )
311
315
}
312
316
}
313
317
@@ -323,14 +327,14 @@ def mixinSrg = new File(mixinDir, "${mixingConfigRefMap}.srg")
323
327
def mixinRefMap = new File (mixinDir, mixingConfigRefMap)
324
328
325
329
task generateAssets {
326
- if (usesMixins. toBoolean()) {
330
+ if (usesMixins. toBoolean() && ! mixinPlugin . isEmpty() ) {
327
331
getFile(" /src/main/resources/mixins." + modId + " .json" ). text = """ {
328
332
"required": true,
329
- "minVersion": "0.7.11 ",
333
+ "minVersion": "${ mixinPluginMinimumVersion } ",
330
334
"package": "${ modGroup} .${ mixinsPackage} ",
331
335
"plugin": "${ modGroup} .${ mixinPlugin} ",
332
336
"refmap": "${ mixingConfigRefMap} ",
333
- "target": "@env(DEFAULT)",
337
+ "target": "@env(${ mixinPluginPreInit.toBoolean() ? "PREINIT": " DEFAULT" } )",
334
338
"compatibilityLevel": "JAVA_8"
335
339
}
336
340
@@ -501,9 +505,16 @@ def getManifestAttributes() {
501
505
}
502
506
503
507
if (usesMixins. toBoolean()) {
508
+ String [] configs = [];
509
+ if (! mixinPlugin. isEmpty()) {
510
+ configs + = [" mixins.${ modId} .json" ];
511
+ }
512
+ if (! mixinConfigs. isEmpty()) {
513
+ configs + = [mixinConfigs];
514
+ }
504
515
manifestAttributes + = [
505
516
" TweakClass" : " org.spongepowered.asm.launch.MixinTweaker" ,
506
- " MixinConfigs" : " mixins. " + modId + " .json " + (mixinPreinitConfig ? " ," + mixinPreinitConfig : " " ),
517
+ " MixinConfigs" : String . join( " ," , configs ),
507
518
" ForceLoadAsMod" : ! containsMixinsAndOrCoreModOnly. toBoolean()
508
519
]
509
520
}
@@ -1077,6 +1088,9 @@ def checkPropertyExists(String propertyName) {
1077
1088
}
1078
1089
1079
1090
def propertyDefaultIfUnset (String propertyName , defaultValue ) {
1091
+ if (! project. hasProperty(propertyName)) {
1092
+ System . err. println (" Your gradle.properties is missing the $propertyName entry. It has been automatically set to \" $defaultValue \" as fallback. You can find all properties and their description here: https://github.com/FalsePattern/ExampleMod1.7.10/blob/main/gradle.properties" )
1093
+ }
1080
1094
if (! project. hasProperty(propertyName) || project. property(propertyName) == " " ) {
1081
1095
project. ext. setProperty(propertyName, defaultValue)
1082
1096
}
0 commit comments