Remove Unimined and restore Architectury build system
This commit is contained in:
+88
-43
@@ -1,44 +1,98 @@
|
||||
unimined.minecraft {
|
||||
neoForged {
|
||||
loader neoforge_version
|
||||
mixinConfig("DistantHorizons.neoforge.mixins.json")
|
||||
|
||||
file("build/sourcesSets/main/META-INF/").mkdirs()
|
||||
accessTransformer(aw2at(
|
||||
project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener"),
|
||||
file("build/sourcesSets/main/META-INF/accesstransformer.cfg") // We'd wanna output the access transformer to somewhere where it'll only appear in the final jar
|
||||
))
|
||||
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()
|
||||
}
|
||||
|
||||
// TODO this is already defined in the main settings.gradle file, why doesn't it work unless also defined here? (If compiling does work without this block feel free to remove)
|
||||
repositories {
|
||||
maven {
|
||||
name "Neoforge"
|
||||
url "https://maven.neoforged.net/releases/"
|
||||
}
|
||||
}
|
||||
|
||||
//loom {
|
||||
// forge {
|
||||
// convertAccessWideners.set(true)
|
||||
// extraAccessWideners.add("lod.accesswidener")
|
||||
// mixinConfigs("DistantHorizons.mixins.json")
|
||||
// }
|
||||
//}
|
||||
|
||||
loom {
|
||||
silentMojangMappingsLicense() // Shut the licencing warning
|
||||
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")
|
||||
|
||||
neoForge {
|
||||
// Access wideners are now defined in the `remapJar.atAccessWideners`
|
||||
// convertAccessWideners = true
|
||||
// extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
|
||||
|
||||
// Mixins are now defined in the `mods.toml`
|
||||
// mixinConfigs = [
|
||||
// "DistantHorizons.mixins.json"
|
||||
// ]
|
||||
}
|
||||
mixin {
|
||||
// Mixins are now defined in the `mods.toml`
|
||||
// mixinConfigs = [
|
||||
// "DistantHorizons.mixins.json"
|
||||
// ]
|
||||
}
|
||||
|
||||
// "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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
remapJar {
|
||||
inputFile = shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
// classifier null
|
||||
|
||||
atAccessWideners.add("distanthorizons.accesswidener")
|
||||
}
|
||||
|
||||
def addMod(path, enabled) {
|
||||
if (enabled == "2")
|
||||
dependencies { modImplementation(path) }
|
||||
dependencies { implementation(path) }
|
||||
else if (enabled == "1")
|
||||
dependencies { compileOnly(path) }
|
||||
dependencies { modCompileOnly(path) }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Architectury API
|
||||
// if (minecraft_version == "1.16.5") {
|
||||
// implementation("me.shedaniel:architectury-forge:${rootProject.architectury_version}")
|
||||
// } else {
|
||||
// implementation("dev.architectury:architectury-forge:${rootProject.architectury_version}")
|
||||
// }
|
||||
|
||||
// Starlight
|
||||
addMod("curse.maven:starlight-forge-526854:${rootProject.starlight_version_forge}", rootProject.enable_starlight_forge)
|
||||
// annotationProcessor "org.spongepowered:mixin:0.8.4:processor"
|
||||
|
||||
addMod("curse.maven:TerraForged-363820:${rootProject.terraforged_version}", rootProject.enable_terraforged)
|
||||
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)
|
||||
|
||||
// annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
|
||||
|
||||
// if (System.getProperty("idea.sync.active") != "true") {
|
||||
// annotationProcessor "org.spongepowered:mixin:0.8.4:processor"
|
||||
// }
|
||||
}
|
||||
|
||||
task deleteResources(type: Delete) {
|
||||
@@ -54,20 +108,11 @@ processResources {
|
||||
dependsOn(tasks.named('copyAllResources'))
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
runClient {
|
||||
dependsOn(tasks.named('copyAllResources'))
|
||||
finalizedBy(deleteResources)
|
||||
}
|
||||
tasks.named('runClient') {
|
||||
dependsOn(tasks.named('copyAllResources'))
|
||||
finalizedBy(deleteResources)
|
||||
}
|
||||
|
||||
remapJar {
|
||||
inputFile = shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
// classifier null
|
||||
}
|
||||
|
||||
|
||||
sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
@@ -78,4 +123,4 @@ sourcesJar {
|
||||
// withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
||||
// skip()
|
||||
// }
|
||||
//}
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user