Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DjMbLQujBHunCCu5GpsHaT
36 lines
1.8 KiB
Groovy
36 lines
1.8 KiB
Groovy
plugins { id 'fabric-loom' version '1.8.13' }
|
|
def mc = (providers.gradleProperty('mcVersion').orNull ?: project.findProperty('mcVersion') ?: '1.21.1').toString().trim()
|
|
if (!['1.20.1', '1.21.1'].contains(mc)) throw new GradleException("Use the modern build for 26.x (got '${mc}')")
|
|
def targetJava = mc == '1.20.1' ? 17 : 21
|
|
loom { mixin { defaultRefmapName = 'scopenet.refmap.json' } }
|
|
if (providers.gradleProperty('verifyMixins').isPresent()) {
|
|
loom { runs { server { vmArg '-Dscopenet.verifyMixins=true' } } }
|
|
}
|
|
java.sourceCompatibility = JavaVersion.toVersion(targetJava)
|
|
java.targetCompatibility = JavaVersion.toVersion(targetJava)
|
|
def features = mc == '1.20.1' // commands, permissions, economy, client link: Fabric API based, 1.20.1 only for now
|
|
dependencies {
|
|
minecraft "com.mojang:minecraft:${mc}"
|
|
mappings loom.officialMojangMappings()
|
|
modImplementation 'net.fabricmc:fabric-loader:0.16.10'
|
|
implementation project(':common')
|
|
if (features) {
|
|
modImplementation 'net.fabricmc.fabric-api:fabric-api:0.92.2+1.20.1'
|
|
// Optional at runtime: present only when the LuckPerms mod is installed.
|
|
compileOnly 'net.luckperms:api:5.4'
|
|
}
|
|
}
|
|
if (features) sourceSets.main.java.srcDirs += ['src/mc1.20.1/java']
|
|
sourceSets.main.java.srcDirs += ['../minecraft/src/main/java', "../minecraft/src/${mc}/java"]
|
|
sourceSets.main.resources.srcDirs += ['../minecraft/src/main/resources']
|
|
apply from: '../minecraft/build-info.gradle'
|
|
processResources {
|
|
inputs.properties(version: project.version, mc: mc, java: targetJava)
|
|
filesMatching('fabric.mod.json') { expand(version: project.version, mc: mc, java: targetJava) }
|
|
}
|
|
jar {
|
|
archiveBaseName = "scopenet-fabric-${mc}"
|
|
from project(':common').sourceSets.main.output
|
|
}
|
|
base.archivesName = "scopenet-fabric-${mc}"
|