From 617515822592d341416c48de62c06f24a328f67f Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sun, 18 Apr 2021 17:01:05 +0200 Subject: [PATCH] Put the base minecraft version in mod files during processing --- build.gradle.kts | 13 +++++++++---- fabric/src/main/resources/fabric.mod.json | 2 +- forge/src/main/resources/META-INF/mods.toml | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 77d1363..27eb016 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 = "mod_version" to (rootProject.version as String) - filesNotMatching(listOf("*.png", "*/*.ttf")) { - expand(mutableMapOf(modVersionPair)) + val ModProperties = mapOf( + "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" diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 8c9f5cb..f0427fc 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ "depends": { "fabricloader": ">=0.9.3", "fabric-resource-loader-v0": "*", - "minecraft": ">=1.16" + "minecraft": ">=${minecraft_version}" }, "breaks": { "modmenu": "<1.15.0" diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 08b5d12..1490432 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -23,6 +23,6 @@ side = "BOTH" [[dependencies.snowygui]] modId = "minecraft" mandatory = true -versionRange = "[1.16.1,)" +versionRange = "[${minecraft_version},)" ordering = "NONE" side = "BOTH" \ No newline at end of file