Fix the reflections used to make the main buildscript compatible with loom 0.7.3 etc
This commit is contained in:
parent
0be77d4c35
commit
a20e8cd55b
|
@ -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 ->
|
||||
|
|
Loading…
Reference in New Issue