101 lines
2.6 KiB
Groovy
101 lines
2.6 KiB
Groovy
plugins {
|
|
// Note: This is only needed for multi-loader projects
|
|
// The main architectury loom version is set at the start of the root build.gradle
|
|
id "architectury-plugin" version "3.4-SNAPSHOT"
|
|
}
|
|
|
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
architectury {
|
|
platformSetupLoomIde()
|
|
neoForge()
|
|
}
|
|
|
|
loom {
|
|
silentMojangMappingsLicense() // Shut the licencing warning
|
|
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")
|
|
|
|
neoForge {
|
|
// Access wideners are defined in the `remapJar.atAccessWideners`
|
|
|
|
// Mixins are defined in the `mods.toml`
|
|
}
|
|
mixin {
|
|
// Mixins are defined in the `mods.toml`
|
|
}
|
|
|
|
// "runs" isn't required, but when we do need it then it can be useful
|
|
runs {
|
|
client {
|
|
client()
|
|
setConfigName("NeoForge Client")
|
|
ideConfigGenerated(true)
|
|
runDir("../run")
|
|
//vmArgs("-XX:-OmitStackTraceInFastThrow", minecraftMemoryJavaArg)
|
|
}
|
|
server {
|
|
server()
|
|
setConfigName("NeoForge Server")
|
|
ideConfigGenerated(true)
|
|
runDir("../run")
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
def addMod(path, enabled) {
|
|
if (enabled == "2")
|
|
dependencies { implementation(path) }
|
|
else if (enabled == "1")
|
|
dependencies { modCompileOnly(path) }
|
|
}
|
|
dependencies {
|
|
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
|
|
mappings loom.layered()
|
|
{
|
|
// Mojmap mappings
|
|
officialMojangMappings()
|
|
// Parchment mappings (it adds parameter mappings & javadoc)
|
|
parchment("org.parchmentmc.data:parchment-${rootProject.parchment_version}@zip")
|
|
}
|
|
|
|
|
|
// Neoforge
|
|
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
|
|
addMod("curse.maven:TerraFirmaCraft-302973:4616004", rootProject.enable_terrafirmacraft)
|
|
}
|
|
|
|
|
|
|
|
task deleteResources(type: Delete) {
|
|
delete file("build/resources/main")
|
|
}
|
|
|
|
tasks.register('copyAllResources') {
|
|
dependsOn(copyCoreResources)
|
|
dependsOn(copyCommonLoaderResources)
|
|
}
|
|
|
|
processResources {
|
|
dependsOn(tasks.named('copyAllResources'))
|
|
}
|
|
|
|
tasks.named('runClient') {
|
|
dependsOn(tasks.named('copyAllResources'))
|
|
finalizedBy(deleteResources)
|
|
}
|
|
|
|
remapJar {
|
|
inputFile = shadowJar.archiveFile
|
|
dependsOn shadowJar
|
|
|
|
atAccessWideners.add("distanthorizons.accesswidener")
|
|
}
|
|
|
|
sourcesJar {
|
|
def commonSources = project(":common").sourcesJar
|
|
dependsOn commonSources
|
|
from commonSources.archiveFile.map { zipTree(it) }
|
|
}
|