From 9535e7c7dd6a491550e06c60c55f2626631633b5 Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Thu, 23 May 2024 15:52:43 +0200 Subject: [PATCH] fix(1.20.6): Fix Forge builds --- buildSrc/src/main/groovy/multiloader-common.gradle | 3 ++- forge/build.gradle | 4 ++++ forge/dependencies.gradle | 2 +- .../net/blay09/mods/craftingtweaks/ForgeCraftingTweaks.java | 5 +++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle index eae0750..8561dfa 100644 --- a/buildSrc/src/main/groovy/multiloader-common.gradle +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -64,7 +64,8 @@ jar { 'Implementation-Title' : project.name, 'Implementation-Version': project.jar.archiveVersion, 'Implementation-Vendor' : mod_author, - 'Built-On-Minecraft' : minecraft_version + 'Built-On-Minecraft' : minecraft_version, + 'MixinConfigs' : "${mod_id}.mixins.json,${mod_id}.${project.name}.mixins.json", ]) } } diff --git a/forge/build.gradle b/forge/build.gradle index 8d1b747..1a3471c 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -16,6 +16,8 @@ mixin { minecraft { mappings channel: 'official', version: minecraft_version + reobf = false + copyIdeResources = true // Automatically enable forge AccessTransformers if the file exists @@ -75,6 +77,8 @@ sourceSets.main.resources.srcDir 'src/generated/resources' dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor" + // temporary hacky fix as suggested by Forge + implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } } } apply from: rootProject.file('repositories.gradle') diff --git a/forge/dependencies.gradle b/forge/dependencies.gradle index 3453c00..a221bb3 100644 --- a/forge/dependencies.gradle +++ b/forge/dependencies.gradle @@ -1,5 +1,5 @@ dependencies { - implementation fg.deobf("net.blay09.mods:balm-forge:${balm_version}") { + implementation("net.blay09.mods:balm-forge:${balm_version}") { changing = balm_version.contains("SNAPSHOT") } } \ No newline at end of file diff --git a/forge/src/main/java/net/blay09/mods/craftingtweaks/ForgeCraftingTweaks.java b/forge/src/main/java/net/blay09/mods/craftingtweaks/ForgeCraftingTweaks.java index 38a2be9..4f1b172 100644 --- a/forge/src/main/java/net/blay09/mods/craftingtweaks/ForgeCraftingTweaks.java +++ b/forge/src/main/java/net/blay09/mods/craftingtweaks/ForgeCraftingTweaks.java @@ -1,6 +1,7 @@ package net.blay09.mods.craftingtweaks; import net.blay09.mods.balm.api.Balm; +import net.blay09.mods.balm.api.EmptyLoadContext; import net.blay09.mods.balm.api.client.BalmClient; import net.blay09.mods.craftingtweaks.client.CraftingTweaksClient; import net.minecraftforge.api.distmarker.Dist; @@ -13,8 +14,8 @@ @Mod(CraftingTweaks.MOD_ID) public class ForgeCraftingTweaks { public ForgeCraftingTweaks() { - Balm.initialize(CraftingTweaks.MOD_ID, CraftingTweaks::initialize); - DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> BalmClient.initialize(CraftingTweaks.MOD_ID, CraftingTweaksClient::initialize)); + Balm.initialize(CraftingTweaks.MOD_ID, EmptyLoadContext.INSTANCE, CraftingTweaks::initialize); + DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> BalmClient.initialize(CraftingTweaks.MOD_ID, EmptyLoadContext.INSTANCE, CraftingTweaksClient::initialize)); FMLJavaModLoadingContext.get().getModEventBus().addListener(IMCHandler::processInterMod); ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> IExtensionPoint.DisplayTest.IGNORESERVERONLY, (a, b) -> true));