wao
This commit is contained in:
+17
-87
@@ -1,107 +1,38 @@
|
||||
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"
|
||||
id 'unimined-forge'
|
||||
}
|
||||
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
forge()
|
||||
}
|
||||
|
||||
//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")
|
||||
|
||||
forge {
|
||||
convertAccessWideners = true
|
||||
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
|
||||
|
||||
mixinConfigs = [
|
||||
"DistantHorizons.forge.mixins.json"
|
||||
]
|
||||
}
|
||||
|
||||
// "runs" isn't required, but when we do need it then it can be useful
|
||||
runs {
|
||||
client {
|
||||
client()
|
||||
setConfigName("Forge Client")
|
||||
ideConfigGenerated(false) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
|
||||
runDir("../run/client")
|
||||
vmArgs(
|
||||
// https://github.com/FabricMC/fabric-loom/issues/915#issuecomment-1609154390
|
||||
"-Dminecraft.api.auth.host=https://nope.invalid",
|
||||
"-Dminecraft.api.account.host=https://nope.invalid",
|
||||
"-Dminecraft.api.session.host=https://nope.invalid",
|
||||
"-Dminecraft.api.services.host=https://nope.invalid",
|
||||
// https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
|
||||
"-Dio.netty.leakDetection.level=advanced"
|
||||
)
|
||||
programArgs("--username", "Dev")
|
||||
}
|
||||
server {
|
||||
server()
|
||||
setConfigName("Forge Server")
|
||||
ideConfigGenerated(false)
|
||||
runDir("../run/server")
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
remapJar {
|
||||
inputFile = shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
}
|
||||
// ==================== Mod Dependency Helper ====================
|
||||
|
||||
def addMod(path, enabled) {
|
||||
if (enabled == "2")
|
||||
dependencies { implementation(path) }
|
||||
dependencies { modImplementation(path) }
|
||||
else if (enabled == "1")
|
||||
dependencies { modCompileOnly(path) }
|
||||
dependencies { compileOnly(path) }
|
||||
}
|
||||
|
||||
|
||||
// ==================== Dependencies ====================
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
// Forge
|
||||
forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}"
|
||||
|
||||
// TerraForged
|
||||
addMod("curse.maven:TerraForged-363820:${rootProject.terraforged_version}", rootProject.enable_terraforged)
|
||||
|
||||
// TerraFirmaCraft
|
||||
addMod("curse.maven:TerraFirmaCraft-302973:4616004", rootProject.enable_terrafirmacraft)
|
||||
|
||||
|
||||
if ( // Only run on MC 1.20.6 or later
|
||||
// FIXME: Add an environment variable for the Major, Minor, and Patch version number of Minecraft
|
||||
minecraft_version.split("\\.")[1].toInteger() >= 20 &&
|
||||
(
|
||||
minecraft_version.split("\\.").length > 1 && // Incase there isn't a minor version
|
||||
minecraft_version.split("\\.")[2].toInteger() >= 6
|
||||
)
|
||||
) {
|
||||
// (potential) hack fix, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
|
||||
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') //{ version { strictly '5.0.4' } }
|
||||
// TODO: Check if this is still needed and if so ensure this code works for MC 26.1+
|
||||
// (potential) hack fix for MC 1.20.6 and later, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
|
||||
def mcParts = rootProject.minecraft_version.split("\\.")
|
||||
if (mcParts[1].toInteger() >= 20 && (mcParts.length > 2 && mcParts[2].toInteger() >= 6)) {
|
||||
implementation('net.sf.jopt-simple:jopt-simple:5.0.4')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ==================== Tasks ====================
|
||||
|
||||
task deleteResources(type: Delete) {
|
||||
delete file("build/resources/main")
|
||||
}
|
||||
@@ -119,4 +50,3 @@ tasks.named('runClient') {
|
||||
dependsOn(tasks.named('copyAllResources'))
|
||||
finalizedBy(deleteResources)
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
loom.platform=forge
|
||||
Reference in New Issue
Block a user