Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

ForceLoadAsMod causes mod to be loaded twice with latest forge (that includes new dependency extraction)

Open Niko-sk2x opened this issue 7 years ago • 3 comments

Some user just reported to me that CubicChunks mod gets loaded twice and is detected as dumplicate mod, causing a crash on latest forge version.

Unfortunately, removing ForceLoadAsMod makes it not load as mod at all, and adding FMLCorePluginContainsFMLMod: true doesn't work either.

Based on debug log output it looks like the jar is found once when looking for jarmods (how?) and once when scanning mods/.

Here is the debug log he gave me: debug.log

Niko-sk2x avatar Apr 21 '18 19:04 Niko-sk2x

Ok I will take a look into this. The problem with the FML agent is obviously that it's tightly-coupled to the structure of forge and thus if any internal changes take place then it will break.

Mumfrey avatar Apr 23 '18 12:04 Mumfrey

Just because Barteks recommended that I leave a message about it here, I found during my testing that the duplicate mod scenario only happens on Forge servers and not on clients. Why it does this, I'm not sure, but I feel something is done differently on the servers rather than the client to cause this.

ZombieHDGaming avatar May 11 '18 15:05 ZombieHDGaming

As an interesting turn of events, there is actually a way to get around the duplicate mod scenario here. After looking at the mod LagGoggles, I found it weird that nothing was happening with it on newer versions. Upon adding the top option in this code:

manifest.attributes(
            "FMLCorePluginContainsFMLMod": "true",
            "TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
            "MixinConfigs": "mixins.vanillafix.json",
            "FMLCorePlugin": "org.dimdev.vanillafix.VanillaFixLoadingPlugin",
            "ForceLoadAsMod": "true"
    )

The mod no longer throws a duplicate mod found exception on servers. I'm not sure why the FMLCorePluginContainsFMLMod option makes a difference, but it fixes the issue to say the least on my end. @Barteks2x I'd suggest adding that option to your build file and see if the error still occurs.

ZombieHDGaming avatar May 11 '18 17:05 ZombieHDGaming