更改ModID

同步Fabric Mod Template那边的Kotlin DSL官方配置
移除main入口类的`@Deprecated`标记
( 我当初为什么要弃用它?
补全ChangeLog.md
( 已经彻底忘记它的存在了
更新Github Action配置
更新Gradle版本

由于本次更改不存在对玩家具有实质影响的内容,故合并到下一个Mod版本内一并发布
This commit is contained in:
TheWhiteDog9487
2026-06-01 15:14:22 +08:00
parent 37722dcd8f
commit 5cb7a45ff4
21 changed files with 148 additions and 132 deletions

View File

@@ -1,16 +1,17 @@
plugins {
id("net.fabricmc.fabric-loom") version "1.15-SNAPSHOT"
id("maven-publish")
id("net.fabricmc.fabric-loom")
`maven-publish`
}
version = project.extra["mod_version"] as String
group = project.extra["maven_group"] as String
base {
archivesName.set(project.extra["archives_base_name"] as String)
}
version = providers.gradleProperty("mod_version").get()
group = providers.gradleProperty("maven_group").get()
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
name = "Xander Maven"
url = uri("https://maven.isxander.dev/releases") }
@@ -25,68 +26,77 @@ loom {
splitEnvironmentSourceSets()
mods {
create("twd-sasf") {
sourceSet(sourceSets["main"])
sourceSet(sourceSets["client"])
register("serveraddressspacefix") {
sourceSet(sourceSets.main.get())
sourceSet(sourceSets.getByName("client"))
}
}
accessWidenerPath = file("src/main/resources/twd-sasf.classtweaker")
accessWidenerPath = file("src/main/resources/serveraddressspacefix.classtweaker")
}
dependencies {
// To change the versions see the gradle.properties file
minecraft("com.mojang:minecraft:${project.extra["minecraft_version"]}")
implementation("net.fabricmc:fabric-loader:${project.extra["loader_version"]}")
minecraft("com.mojang:minecraft:${providers.gradleProperty("minecraft_version").get()}")
implementation("net.fabricmc:fabric-loader:${providers.gradleProperty("loader_version").get()}")
// Fabric API. This is technically optional, but you probably want it anyway.
implementation("net.fabricmc.fabric-api:fabric-api:${project.extra["fabric_api_version"]}")
implementation("net.fabricmc.fabric-api:fabric-api:${providers.gradleProperty("fabric_api_version").get()}")
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
// "modImplementation"("net.fabricmc.fabric-api:fabric-api-deprecated:${project.extra["fabric_version"]}")
implementation("com.terraformersmc:modmenu:${project.extra["modmenu_version"]}")
implementation("dev.isxander:yet-another-config-lib:${project.extra["yacl_version"]}")
implementation("com.terraformersmc:modmenu:${providers.gradleProperty("modmenu_version").get()}")
implementation("dev.isxander:yet-another-config-lib:${providers.gradleProperty("yacl_version").get()}")
}
tasks.processResources {
inputs.property("version", project.version)
val version = version
inputs.property("version", version)
filesMatching("fabric.mod.json") {
expand("version" to project.version)
expand("version" to version)
}
}
tasks.withType<JavaCompile> {
options.release.set(25)
tasks.withType<JavaCompile>().configureEach {
options.release = 25
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
tasks.jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" } }
val projectName = project.name
inputs.property("projectName", projectName)
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:archiveFileName
archiveFileName = "${project.base.archivesName.get()}-${project.version} mc${project.extra["compatible_with"]}.jar"}
from("LICENSE") {
rename { "${it}_$projectName" }
}
archiveFileName = "ServerAddressSpaceFix-${project.version} mc${providers.gradleProperty("compatible_with").get()}.jar"
}
tasks.named<Jar>("sourcesJar") {
archiveFileName = "${project.base.archivesName.get()}-${project.version} mc${project.extra["compatible_with"]}-sources.jar"}
archiveFileName = "ServerAddressSpaceFix-${project.version} mc${providers.gradleProperty("compatible_with").get()}-sources.jar"}
// configure the maven publication
publishing {
publications {
create<MavenPublication>("mavenJava") {
register<MavenPublication>("mavenJava") {
from(components["java"])
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for retrieving dependencies.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}