Put the base minecraft version in mod files during processing

This commit is contained in:
Username404-59 2021-04-18 17:01:05 +02:00
parent 9dbe16748f
commit 6175158225
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 11 additions and 6 deletions

View File

@ -86,6 +86,7 @@ subprojects {
}
}
val mcBase: String = rootProject.architectury.minecraft.dropLast(2)
allprojects {
apply(plugin = "java")
apply(plugin = "architectury-plugin")
@ -137,9 +138,13 @@ allprojects {
from(this)
}
}
val modVersionPair: Pair<String, String> = "mod_version" to (rootProject.version as String)
filesNotMatching(listOf("*.png", "*/*.ttf")) {
expand(mutableMapOf(modVersionPair))
val ModProperties = mapOf<String, String>(
"mod_version" to (rootProject.version as String),
"minecraft_version" to mcBase
)
inputs.properties(ModProperties)
filesNotMatching(listOf("*.png")) {
expand(ModProperties)
}
}
}
@ -156,7 +161,7 @@ tasks {
versionNumber = version.toString()
projectId = "OuGyGg6A"
token = envStr
addGameVersion(architectury.minecraft.dropLast(2))
addGameVersion(mcBase)
versionType = VersionType.ALPHA
detectLoaders = false
versionName = "${project.name} $versionNumber for Minecraft $gameVersions and higher"

View File

@ -30,7 +30,7 @@
"depends": {
"fabricloader": ">=0.9.3",
"fabric-resource-loader-v0": "*",
"minecraft": ">=1.16"
"minecraft": ">=${minecraft_version}"
},
"breaks": {
"modmenu": "<1.15.0"

View File

@ -23,6 +23,6 @@ side = "BOTH"
[[dependencies.snowygui]]
modId = "minecraft"
mandatory = true
versionRange = "[1.16.1,)"
versionRange = "[${minecraft_version},)"
ordering = "NONE"
side = "BOTH"