diff --git a/build.gradle.kts b/build.gradle.kts index 2d4bb38..3ef1b90 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,13 +62,15 @@ 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 loomMajorRelease = LoomGradlePlugin.LOOM_VERSION.run { val numberPos = indexOf('.') + 1 substring(numberPos, indexOf('.', numberPos)) - }.toShort() < 10) { - getField("refmapName").set(this@configure, refmap) + }.toShort() + if (loomMajorRelease < 10) { + if (loomMajorRelease < 9) getField("refmapName").set(this@configure, refmap) + else getMethod("setRefmapName", String::class.java).invoke(this@configure, refmap) getMethod("mixinConfig", Array::class.java).invoke(this@configure, arrayOf("snowygui-${project.name}.mixins.json")) } else { getDeclaredMethod("getMixin").invoke(this@configure).run {