2022-05-31 10:50:46 -04:00
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
eclipse
|
|
|
|
id("net.minecraftforge.gradle") version ("5.1.+")
|
2022-05-31 12:41:30 -04:00
|
|
|
id("org.parchmentmc.librarian.forgegradle") version ("1.+")
|
2022-05-31 10:50:46 -04:00
|
|
|
id("org.spongepowered.mixin") version ("0.7-SNAPSHOT")
|
|
|
|
`maven-publish`
|
|
|
|
}
|
|
|
|
|
|
|
|
val minecraftVersion: String by project
|
|
|
|
val mixinVersion: String by project
|
|
|
|
val forgeVersion: String by project
|
|
|
|
val modName: String by project
|
|
|
|
val modAuthor: String by project
|
|
|
|
val modId: String by project
|
2022-05-31 12:41:30 -04:00
|
|
|
val mappingsChannel: String by project
|
|
|
|
val mappingsVersion: String by project
|
2022-05-31 17:19:29 -04:00
|
|
|
val jeiVersion: String by project
|
|
|
|
val almostlibVersion: String by project
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
val baseArchiveName = "${modName}-forge-${minecraftVersion}"
|
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName.set(baseArchiveName)
|
|
|
|
}
|
|
|
|
|
|
|
|
minecraft {
|
2022-05-31 12:41:30 -04:00
|
|
|
mappings(mappingsChannel, "${mappingsVersion}-${minecraftVersion}")
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
runs {
|
|
|
|
create("client") {
|
|
|
|
workingDirectory(project.file("run"))
|
|
|
|
ideaModule("${rootProject.name}.${project.name}.main")
|
|
|
|
taskName("Client")
|
|
|
|
property("mixin.env.remapRefMap", "true")
|
|
|
|
property("mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")
|
|
|
|
mods {
|
|
|
|
create(modId) {
|
|
|
|
source(sourceSets.main.get())
|
|
|
|
source(project(":Common").sourceSets.main.get())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
create("server") {
|
|
|
|
workingDirectory(project.file("run"))
|
|
|
|
ideaModule("${rootProject.name}.${project.name}.main")
|
|
|
|
taskName("Server")
|
|
|
|
property("mixin.env.remapRefMap", "true")
|
|
|
|
property("mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")
|
|
|
|
mods {
|
|
|
|
create(modId) {
|
|
|
|
source(sourceSets.main.get())
|
|
|
|
source(project(":Common").sourceSets.main.get())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.get().resources.srcDir("src/generated/resources")
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
minecraft("net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}")
|
|
|
|
compileOnly(project(":Common"))
|
|
|
|
|
2022-05-31 17:19:29 -04:00
|
|
|
compileOnly( fg.deobf("mezz.jei:jei-${minecraftVersion}:${jeiVersion}:api"))
|
|
|
|
runtimeOnly( fg.deobf("mezz.jei:jei-${minecraftVersion}:${jeiVersion}"))
|
|
|
|
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:IE-231951:3755665"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:JAOPCA-266936:3802370"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:cofh-69162:3803484"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:thermalfoundation-222880:3803495"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:thermalexp-69163:3803489"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:mekanism-268560:3810540"))
|
|
|
|
runtimeOnly(fg.deobf("curse.maven:nihilo-400012:3810814"))
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
annotationProcessor("org.spongepowered:mixin:${mixinVersion}:processor")
|
|
|
|
}
|
|
|
|
|
|
|
|
mixin {
|
|
|
|
add(sourceSets.main.get(), "${modId}.refmap.json")
|
|
|
|
config("${modId}-common.mixins.json")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
source(project(":Common").sourceSets.main.get().allSource)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
from(project(":Common").sourceSets.main.get().resources)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
jar {
|
|
|
|
finalizedBy("reobfJar")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
register("mavenJava", MavenPublication::class) {
|
|
|
|
artifactId = baseArchiveName
|
|
|
|
artifact(tasks.jar)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("file://${System.getenv("local_maven")}")
|
|
|
|
}
|
|
|
|
}
|