plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "2.2.10"
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
// You usually don’t need extra repos — Loom handles Minecraft + Fabric automatically
}
loom {
splitEnvironmentSourceSets()
mods {
"headrevival" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}
fabricApi {
configureDataGeneration {
client = true
}
}
dependencies {
// Core
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API (needed for registry, events, etc.)
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Kotlin support
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": inputs.properties.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "21"
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
jar {
inputs.property "archivesName", project.base.archivesName
from("LICENSE") {
rename { "${it}_${inputs.properties.archivesName}" }
}
}