Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
persist-credentials: false

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ To update this template to a newer Minecraft version, follow these steps:
2. Update `gradle/libs.versions.toml` (the versions catalog):
- Set the version entries to the new versions. Common keys to update are:
- `versions.minecraft` - Minecraft version
- `versions.yarn-mappings` - Yarn mappings
- `versions.fabric-loader` - Fabric loader version
- `versions.meteor` - Meteor Client snapshot version
- If your addon depends on other libraries listed under the `[libraries]` section, update their versions there as
Expand All @@ -53,7 +52,7 @@ To update this template to a newer Minecraft version, follow these steps:
- Windows (cmd.exe): `gradlew.bat wrapper --gradle-version <version> && gradlew.bat wrapper`
- This updates and regenerates the Gradle Wrapper scripts (`gradlew`, `gradlew.bat`, etc.) for the specified version.
5. Update your source code:
- Adjust for Minecraft or Yarn mapping changes: method names, imports, mixins, etc.
- Adjust for Minecraft source changes: method names, imports, mixins, etc.
- Check for Meteor Client API changes that may affect your addon by comparing against the
[master branch](https://github.com/MeteorDevelopment/meteor-client/tree/master).
6. Build and test:
Expand Down
33 changes: 24 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ plugins {
alias(libs.plugins.fabric.loom)
}

val archivesBaseName = providers.gradleProperty("archives_base_name").get()
val mavenGroup = providers.gradleProperty("maven_group").get()

base {
archivesName = properties["archives_base_name"] as String
archivesName = archivesBaseName
version = libs.versions.mod.version.get()
group = properties["maven_group"] as String
group = mavenGroup
}

repositories {
Expand Down Expand Up @@ -35,12 +38,24 @@ java {
}

fun toMinecraftCompat(version: String): String {
val match = Regex("""^(\d{2})\.([1-9]\d*)(?:\.([1-9]\d*))?$""")
.matchEntire(version)
?: error("Invalid Minecraft version format: $version. Expected YY.D or YY.D.H")
val stable = Regex("""^(\d{2})\.([1-9]\d*)(?:\.(\d+))?$""")

stable.matchEntire(version)?.let {
val (year, drop, _) = it.destructured
return "~$year.$drop"
}

val pre = Regex("""^(\d{2})\.([1-9]\d*)-pre[-.](\d+)$""")
pre.matchEntire(version)?.let {
return version.replace("-pre-", "-pre.")
}

val rc = Regex("""^(\d{2})\.([1-9]\d*)-rc[-.](\d+)$""")
rc.matchEntire(version)?.let {
return version.replace("-rc-", "-rc.")
}

val (year, drop, _) = match.destructured
return "~$year.$drop"
return version
}

tasks {
Expand All @@ -58,10 +73,10 @@ tasks {
}

jar {
inputs.property("archivesName", project.base.archivesName.get())
inputs.property("archivesName", archivesBaseName)

from("LICENSE") {
rename { "${it}_${inputs.properties["archivesName"]}" }
rename { "${it}_$archivesBaseName" }
}
}

Expand Down
10 changes: 4 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ mod-version = "0.1.0"

# Fabric (https://fabricmc.net/develop)
jdk = "25"
minecraft = "26.1.2"
yarn-mappings = "1.21.11+build.3"
fabric-loader = "0.19.2"
minecraft = "26.2"
fabric-loader = "0.19.3"

# Loom (https://github.com/FabricMC/fabric-loom)
loom = "1.16-SNAPSHOT"
loom = "1.17-SNAPSHOT"

# Meteor (https://github.com/MeteorDevelopment/meteor-client/)
meteor = "26.1.2-SNAPSHOT"
meteor = "26.2-SNAPSHOT"

# Mods

[libraries]
# Fabric base
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
yarn = { module = "net.fabricmc:yarn", version.ref = "yarn-mappings" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }

# Meteor client
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 12 additions & 23 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.