Minecraft ships unobfuscated from 26.1, and 1.21.11 has the last Yarn release, so the shared src/ has to use Mojang's names before newer versions can be added (#39). Each version's sources were migrated with Loom's migrateMappings and merged back into src/, so code that is only active on other versions is migrated too. Where Mojang's names differ between 1.21.x versions, src/ uses the newest ones: Stonecutter replacements swap in the older Identifier/ResourceLocation and Avatar/Player renderer names, and version comments cover the few package moves and renamed methods. The fog mixin now targets setupFog on every version. Yarn's applyFog named two methods from 1.21.6 on, so it also applied to updateBuffer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
82 lines
2.5 KiB
Kotlin
82 lines
2.5 KiB
Kotlin
// Builds one Minecraft version from the shared src/. Stonecutter runs this for each version in
|
|
// stonecutterVersions (settings.gradle.kts), with that version's versions/<v>/gradle.properties.
|
|
plugins {
|
|
id("net.fabricmc.fabric-loom-remap")
|
|
`maven-publish`
|
|
}
|
|
|
|
val minecraftVersion = property("minecraft_version") as String
|
|
val loaderVersion = property("loader_version") as String
|
|
|
|
version = "${property("mod_version")}+$minecraftVersion"
|
|
group = property("maven_group") as String
|
|
|
|
base {
|
|
archivesName = property("archives_base_name") as String
|
|
}
|
|
|
|
dependencies {
|
|
minecraft("com.mojang:minecraft:$minecraftVersion")
|
|
mappings(loom.officialMojangMappings())
|
|
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")
|
|
|
|
// Saturn's emote library (limb bending, Emotecraft emotes)
|
|
include(modImplementation("org.saturnclient:emotes-fabric:${property("emotes_version")}+$minecraftVersion")!!)
|
|
|
|
implementation(project(":common"))
|
|
|
|
for (library in listOf(
|
|
"dev.selimaj:session-java:0.2.0",
|
|
"de.javagl:obj:0.4.0",
|
|
"com.formdev:svgSalamander:1.1.4",
|
|
"com.fasterxml.jackson.core:jackson-databind:2.17.0",
|
|
"com.fasterxml.jackson.core:jackson-annotations:2.17.0",
|
|
"com.fasterxml.jackson.core:jackson-core:2.17.0",
|
|
)) {
|
|
include(implementation(library)!!)
|
|
}
|
|
}
|
|
|
|
// Injects the version values into fabric.mod.json.
|
|
tasks.processResources {
|
|
val values = mapOf(
|
|
"version" to project.version.toString(),
|
|
"minecraft_version" to minecraftVersion,
|
|
"loader_version" to loaderVersion,
|
|
)
|
|
inputs.properties(values)
|
|
filteringCharset = "UTF-8"
|
|
filesMatching("fabric.mod.json") { expand(values) }
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.release = 21
|
|
}
|
|
|
|
java {
|
|
// Loom attaches the sources jar to remapSourcesJar and build.
|
|
withSourcesJar()
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
}
|
|
|
|
tasks.jar {
|
|
val archivesName = base.archivesName
|
|
inputs.property("archivesName", archivesName)
|
|
from("LICENSE") {
|
|
rename { "${it}_${archivesName.get()}" }
|
|
}
|
|
from(project(":common").extensions.getByType<SourceSetContainer>()["main"].output)
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
artifactId = property("archives_base_name") as String
|
|
from(components["java"])
|
|
}
|
|
}
|
|
}
|