diff --git a/forge/build.gradle b/forge/build.gradle index 962dc7c..ad02908 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -7,8 +7,6 @@ plugins { } mixin { - add(sourceSets.main, "${mod_id}.refmap.json") - config("${mod_id}.mixins.json") config("${mod_id}.forge.mixins.json") } @@ -119,4 +117,10 @@ modrinth { dependencies { required.project "balm" } +} + +sourceSets.each { + def dir = layout.buildDirectory.dir("sourcesSets/$it.name") + it.output.resourcesDir = dir + it.java.destinationDirectory = dir } \ No newline at end of file diff --git a/forge/src/main/java/net/blay09/mods/kleeslabs/ForgeKleeSlabs.java b/forge/src/main/java/net/blay09/mods/kleeslabs/ForgeKleeSlabs.java index 407e831..63dc097 100644 --- a/forge/src/main/java/net/blay09/mods/kleeslabs/ForgeKleeSlabs.java +++ b/forge/src/main/java/net/blay09/mods/kleeslabs/ForgeKleeSlabs.java @@ -1,19 +1,22 @@ package net.blay09.mods.kleeslabs; 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.balm.forge.ForgeLoadContext; import net.blay09.mods.kleeslabs.client.KleeSlabsClient; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.loading.FMLEnvironment; @Mod(KleeSlabs.MOD_ID) public class ForgeKleeSlabs { - public ForgeKleeSlabs() { - Balm.initialize(KleeSlabs.MOD_ID, EmptyLoadContext.INSTANCE, KleeSlabs::initialize); - DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> BalmClient.initialize(KleeSlabs.MOD_ID, EmptyLoadContext.INSTANCE, KleeSlabsClient::initialize)); + public ForgeKleeSlabs(FMLJavaModLoadingContext context) { + final var loadContext = new ForgeLoadContext(context.getModEventBus()); + Balm.initialize(KleeSlabs.MOD_ID, loadContext, KleeSlabs::initialize); + if (FMLEnvironment.dist.isClient()) { + BalmClient.initialize(KleeSlabs.MOD_ID, loadContext, KleeSlabsClient::initialize); + } } } diff --git a/forge/src/main/resources/kleeslabs.forge.mixins.json b/forge/src/main/resources/kleeslabs.forge.mixins.json index 32ab96e..e61f949 100644 --- a/forge/src/main/resources/kleeslabs.forge.mixins.json +++ b/forge/src/main/resources/kleeslabs.forge.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "net.blay09.mods.kleeslabs.forge.mixin", "compatibilityLevel": "JAVA_17", - "refmap": "kleeslabs.refmap.json", "mixins": [ ], "client": [