Remove architectury-loom 0.7.4 compatibility since it is useless with Minecraft 1.18.x
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
7252c637b9
commit
058a400fab
|
@ -20,9 +20,7 @@ plugins {
|
|||
id("architectury-plugin") version "[3.4.124, 3.5["
|
||||
id("dev.architectury.loom") version (
|
||||
JavaVersion.current().let { version ->
|
||||
if (version >= JavaVersion.VERSION_16)
|
||||
"[0.10.0, ${if (version.isCompatibleWith(JavaVersion.VERSION_17)) "0.12.1" else "0.10.1"}["
|
||||
else "[0.7.4, 0.7.4.200["
|
||||
"[0.10.0, ${if (version.isCompatibleWith(JavaVersion.VERSION_17)) "0.12.1" else "0.10.1"}["
|
||||
}
|
||||
) apply false
|
||||
id("com.github.ben-manes.versions") version "0.42.0"
|
||||
|
@ -62,26 +60,11 @@ 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
|
||||
with(javaClass) {
|
||||
val loomMajorRelease = LoomGradlePlugin.LOOM_VERSION.run {
|
||||
val numberPos = indexOf('.') + 1
|
||||
substring(numberPos, indexOf('.', numberPos))
|
||||
}.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<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 ->
|
||||
refmapProperty.javaClass.getDeclaredMethod("set", Any::class.java).invoke(refmapProperty, refmap)
|
||||
}
|
||||
if (isForge) {
|
||||
this@with.getDeclaredMethod("getForge").invoke(this@configure).let { forgeObject ->
|
||||
forgeObject.javaClass.getMethod("mixinConfigs", Array<String>::class.java).invoke(forgeObject, arrayOf("snowygui-common.mixins.json", "snowygui-forge.mixins.json"))
|
||||
}
|
||||
}
|
||||
mixin {
|
||||
defaultRefmapName.set(refmap)
|
||||
if (isForge) {
|
||||
forge {
|
||||
mixinConfigs("snowygui-common.mixins.json", "snowygui-forge.mixins.json")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue