Fix the reflections used to make the main buildscript compatible with loom 0.7.3 etc

This commit is contained in:
Username404 2021-10-27 12:25:46 +02:00
parent 0be77d4c35
commit a20e8cd55b
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 3 deletions

View File

@ -62,14 +62,14 @@ subprojects {
}
silentMojangMappingsLicense()
val refmap = "snowygui-${project.name}-refmap.json"
// The following is used to make this buildscript compatible with architectury-loom 0.7.3, 0.9.X, 0.10.X and higher versions
// The following is used to make this buildscript compatible with architectury-loom 0.7.3, 0.9.X, 0.10.X and higher versions
with(javaClass) {
if (LoomGradlePlugin.LOOM_VERSION.run {
val numberPos = indexOf('.') + 1
substring(numberPos, indexOf('.', numberPos))
}.toShort() < 10) {
getDeclaredMethod("setRefmapName", String::class.java).invoke(this@configure, refmap)
getDeclaredMethod("mixinConfig", String::class.java).invoke(this@configure, "snowygui-${project.name}.mixins.json")
getField("refmapName").set(this@configure, refmap)
getMethod("mixinConfig", Array<String>::class.java).invoke(this@configure, arrayOf("snowygui-${project.name}.mixins.json"))
} else {
getDeclaredMethod("getMixin").invoke(this@configure).run {
javaClass.getDeclaredMethod("getDefaultRefmapName").invoke(this).let { refmapProperty ->