fangorn/huorn-minecraft
public
ref:main
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
}
architectury {
platformSetupLoomIde()
forge()
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
forge {
}
runs {
server {
name "Forge Server"
runDir "run/server"
}
client {
name "Forge Client"
runDir "run/client"
programArgs "--server", "localhost"
}
}
}
tasks.register('acceptEula') {
doLast {
def serverDir = file("run/server")
serverDir.mkdirs()
file("run/server/eula.txt").text = "eula=true\n"
}
}
tasks.named('runServer').configure { dependsOn 'acceptEula' }
configurations {
common
shadowCommon
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
}
dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"
modImplementation "dev.architectury:architectury-forge:${rootProject.architectury_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive = false }
shadowCommon(project(path: ":common", configuration: "namedElements")) { transitive = false }
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}
shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier = null
}
jar {
archiveClassifier = "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}