Skip to content

Commit

Permalink
Use a single minecraft_version property
Browse files Browse the repository at this point in the history
  • Loading branch information
ramidzkh committed Dec 2, 2024
1 parent a029164 commit dcd1fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {
group = "me.ramidzkh"
version = System.getenv("FABRISHOT_VERSION") ?: "0.0.0"

String minecraft_version = "1.21.3"

repositories {
maven {
name = "TerraformersMC"
Expand All @@ -28,7 +30,7 @@ repositories {
}

dependencies {
minecraft("net.minecraft:minecraft:1.21.3")
minecraft("net.minecraft:minecraft:${minecraft_version}")
mappings("net.fabricmc:yarn:1.21.3+build.2")
modImplementation("net.fabricmc:fabric-loader:0.16.9")

Expand All @@ -49,11 +51,12 @@ tasks.withType(JavaCompile) {

processResources {
inputs.property("version", project.version)
inputs.property("minecraft_version", minecraft_version)

from("LICENSE")

filesMatching("fabric.mod.json") {
expand("version": project.version)
expand("version": project.version, "minecraft_version": minecraft_version)
}
}

Expand All @@ -76,7 +79,7 @@ System.getenv("CURSEFORGE")?.with { String key ->
releaseType = "release"
}

addGameVersion("1.21")
addGameVersion(minecraft_version)
addGameVersion("Fabric")

mainArtifact(remapJar) {
Expand Down Expand Up @@ -109,7 +112,7 @@ modrinth {
}

uploadFile.set(remapJar)
gameVersions.addAll(["1.21"])
gameVersions.addAll([minecraft_version])

dependencies {
required.project("fabric-api")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "Fabrishot",
"description": "Take high resolution screenshots because why not",
"depends": {
"minecraft": ">=1.21.3",
"minecraft": ">=${minecraft_version}",
"fabric-lifecycle-events-v1": "*",
"fabric-key-binding-api-v1": "*"
},
Expand Down

0 comments on commit dcd1fff

Please sign in to comment.