From a719ec5a3e281161c778f400d9ff016b7f98d3ce Mon Sep 17 00:00:00 2001 From: coolGi Date: Mon, 13 Feb 2023 19:07:50 +1030 Subject: [PATCH] Added some more stuff to attempt to fix forge --- build.gradle | 3 ++ common/build.gradle | 3 ++ forge/build.gradle | 42 ++++++++++++------- .../{ => META-INF}/accesstransformer.cfg | 0 4 files changed, 34 insertions(+), 14 deletions(-) rename forge/src/main/resources/{ => META-INF}/accesstransformer.cfg (100%) diff --git a/build.gradle b/build.gradle index 156a379b2..2f95173ae 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,9 @@ def loadProperties() { for (int i = 0; i < mcVers.size(); i++) { mcVers[i] = mcVers[i].replaceAll(".properties", "") // As we are getting the file names, we should remove the ".properties" at the end to get the versions } + + mcVers.sort() // Sort so it always goes from oldest to newest + int mcIndex = -1 println "Avalible MC versions: ${mcVers}" if (project.hasProperty("mcVer")) { diff --git a/common/build.gradle b/common/build.gradle index d23ba8513..85a243371 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -11,6 +11,9 @@ dependencies { // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // Do NOT use other classes from fabric loader // modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + + // So mixins can be written in common + compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' } diff --git a/forge/build.gradle b/forge/build.gradle index 247b70796..0e41d49e7 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -27,7 +27,7 @@ minecraft { // mappings channel: "official", version: minecraft_version // Vanilla mappings mappings channel: "parchment", version: "${parchment_version}-${minecraft_version}" // Parchment mappings - accessTransformer = project(":forge").file("src/main/resources/accesstransformer.cfg") // FIXME: Find a libary to use fabric's accessWidener instead of forge's own accesstransformer format + accessTransformer = project(":forge").file("src/main/resources/META-INF/accesstransformer.cfg") // FIXME: Find a libary to use fabric's accessWidener instead of forge's own accesstransformer format runs { client { @@ -35,14 +35,25 @@ minecraft { ideaModule "${rootProject.name}.${project.name}.main" taskName "Client" args "-mixins.config=DistantHorizons.mixins.json" + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + mods { + modClientRun { + source sourceSets.main + source project(":common").sourceSets.main + source project(":core").sourceSets.main + source project(":api").sourceSets.main + } + } } - server { - workingDirectory project.file("run") - ideaModule "${rootProject.name}.${project.name}.main" - taskName "Server" - args "-mixins.config=DistantHorizons.mixins.json" - } + // TODO: Do this once client works +// server { +// workingDirectory project.file("run") +// ideaModule "${rootProject.name}.${project.name}.main" +// taskName "Server" +// args "-mixins.config=DistantHorizons.mixins.json" +// } data { workingDirectory project.file("run") @@ -50,13 +61,16 @@ minecraft { args '--mod', "lod", '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') taskName 'Data' args "-mixins.config=DistantHorizons.mixins.json" // To add more mixins, you can just add a comma for another arg - // These may be needed altough im not sure -// mods { -// modDataRun { -// source sourceSets.main -// source project(":common").sourceSets.main -// } -// } + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + mods { + modClientRun { + source sourceSets.main + source project(":common").sourceSets.main + source project(":core").sourceSets.main + source project(":api").sourceSets.main + } + } } } } diff --git a/forge/src/main/resources/accesstransformer.cfg b/forge/src/main/resources/META-INF/accesstransformer.cfg similarity index 100% rename from forge/src/main/resources/accesstransformer.cfg rename to forge/src/main/resources/META-INF/accesstransformer.cfg