168 lines
5.3 KiB
Groovy
168 lines
5.3 KiB
Groovy
plugins {
|
|
id 'eclipse'
|
|
id 'idea'
|
|
id 'maven-publish'
|
|
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
|
|
}
|
|
|
|
version = mod_version
|
|
group = mod_group_id
|
|
|
|
base {
|
|
archivesName = mod_id
|
|
}
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
|
|
|
|
|
|
minecraft {
|
|
mappings channel: mapping_channel, version: mapping_version
|
|
copyIdeResources = true
|
|
|
|
runs {
|
|
configureEach {
|
|
workingDirectory project.file('run')
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
// IMPORTANT: allow Mixin remapping
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
|
|
|
mods {
|
|
"${mod_id}" {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
client {
|
|
property 'forge.enabledGameTestNamespaces', mod_id
|
|
}
|
|
server {
|
|
property 'forge.enabledGameTestNamespaces', mod_id
|
|
args '--nogui'
|
|
}
|
|
|
|
gameTestServer {
|
|
property 'forge.enabledGameTestNamespaces', mod_id
|
|
}
|
|
|
|
data {
|
|
workingDirectory project.file('run-data')
|
|
args '--mod', mod_id, '--all', '--output',
|
|
file('src/generated/resources/'),
|
|
'--existing', file('src/main/resources/')
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|
|
|
repositories {
|
|
mavenLocal() // REQUIRED for local Ascend mod
|
|
mavenCentral()
|
|
|
|
maven {
|
|
name = "Iron's Maven - Release"
|
|
url = "https://code.redspace.io/releases"
|
|
content { includeGroup "io.redspace.ironsspellbooks" }
|
|
}
|
|
maven {
|
|
name = "Iron's Maven - Snapshots"
|
|
url = "https://code.redspace.io/snapshots"
|
|
content { includeGroup "io.redspace.ironsspellbooks" }
|
|
}
|
|
|
|
maven { url = "https://maven.enginehub.org/repo/" }
|
|
maven { url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/" }
|
|
maven { url = "https://maven.theillusivec4.top" }
|
|
maven { url = "https://cursemaven.com" }
|
|
maven { url = "https://maven.blamejared.com" }
|
|
maven { url = "https://maven.kosmx.dev/" }
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
|
|
|
// Local Ascend mod (works because of mavenLocal())
|
|
implementation fg.deobf("net.fretux.ascend:Ascend:2.0.1")
|
|
|
|
// Iron's Spellbooks
|
|
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
|
|
implementation fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}")
|
|
|
|
// GECKOLIB
|
|
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_version}")
|
|
|
|
// Player Animator
|
|
implementation fg.deobf("dev.kosmx.player-anim:player-animation-lib-forge:${player_animator_version}")
|
|
|
|
// Caelus
|
|
compileOnly fg.deobf("top.theillusivec4.caelus:caelus-forge:${caelus_version}:api")
|
|
implementation fg.deobf("top.theillusivec4.caelus:caelus-forge:${caelus_version}")
|
|
|
|
// Curios
|
|
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
|
|
implementation fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
|
|
}
|
|
|
|
|
|
tasks.named('processResources', ProcessResources).configure {
|
|
var replaceProperties = [
|
|
minecraft_version : minecraft_version,
|
|
minecraft_version_range : minecraft_version_range,
|
|
forge_version : forge_version,
|
|
forge_version_range : forge_version_range,
|
|
loader_version_range : loader_version_range,
|
|
mod_id : mod_id,
|
|
mod_name : mod_name,
|
|
mod_license : mod_license,
|
|
mod_version : mod_version,
|
|
mod_authors : mod_authors,
|
|
mod_description : mod_description,
|
|
]
|
|
|
|
inputs.properties replaceProperties
|
|
|
|
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
|
expand replaceProperties + [project: project]
|
|
}
|
|
}
|
|
|
|
tasks.named('jar', Jar).configure {
|
|
manifest {
|
|
attributes([
|
|
'Specification-Title' : mod_id,
|
|
'Specification-Vendor' : mod_authors,
|
|
'Specification-Version' : '1',
|
|
'Implementation-Title' : project.name,
|
|
'Implementation-Version' : project.jar.archiveVersion,
|
|
'Implementation-Vendor' : mod_authors,
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
])
|
|
}
|
|
finalizedBy 'reobfJar'
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
register('mavenJava', MavenPublication) {
|
|
artifact jar
|
|
}
|
|
}
|
|
repositories {
|
|
maven { url "file://${project.projectDir}/mcmodsrepo" }
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
dependsOn tasks.named("createSrgToMcp")
|
|
}
|
|
|
|
tasks.withType(ProcessResources).configureEach {
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
|
} |