SpongeForge Plugin development - crash after setting up environment

Hello,
I am attempting to develop a SpongeForge plugin(Not vanilla sponge, I want to use SpongeForge for this), and after following the documentation’s guide for setup, I encountered the following crash upon running the game, Client or Server.
(Crash report link removed because it is considered spam)
To set up my environment, I followed the following guides, which I was pointed to by this thread:
https://docs.spongepowered.org/stable/en/plugin/internals/mcp-setup.html
https://docs.spongepowered.org/stable/en/plugin/internals/implementation.html
https://docs.spongepowered.org/stable/en/plugin/internals/mixins.html

My build.gradle
To set up the environment, I ran gradle setupDecompWorkspace idea

If there is any additional information I can provide, please let me know.

This could be a problem caused by the other coremod you have loaded. Try without com.wildex999.tickdynamic.LoadingPlugin

This might also be caused by using non-excluded classes in your coremod.

Ok, tried without the coremod, same issue:
http://paste.ubuntu.com/25355167/

And here is my fml-client-latest.log, I hope this helps:
http://paste.ubuntu.com/25355184/

I wonder whether Mixin could be loading twice. There are two mixin instances on the classpath, mixin-0.6.15-SNAPSHOT.jar and spongeforge-1.11.2-2393-6.1.0-BETA-2572-dev.jar
Remove the mixin jar (mixin-0.6.15-SNAPSHOT.jar) from the classpath, see if that fixes it.

Removing the mixin jar caused this:
http://paste.ubuntu.com/25355348/

Also, I checked spongeforge-1.11.2-2393-6.1.0-BETA-2572-dev.jar, and didn’t see any of the same files that are in the mixin jar. The packages in each sponge-related jar, for easy reference:

Oh right, the dev jar doesn’t contain Mixin.
It seems that SpongeCoremod is getting instantiated twice, do you have -Dfml.coreMods.load as a VM arg? Remove it if so, and if spongeforge doesn’t load try adding --tweakClass org.spongepowered.asm.launch.MixinTweaker as a program argument.
(I’m just guessing ideas as I don’t remember how to do it properly)

I was not using -Dfml.coreMods.load for loading the Sponge coremod, but I did try adding the --tweakClass argument, just to see if that would fix it, and the crash changed to this:
http://paste.ubuntu.com/25355532/
And the fml-client-latest.log that goes with that:
http://paste.ubuntu.com/25355551/

I did some debugging with breakpoints, and you’re right, it is getting instantiated twice. It looks to me like Sponge is instantiating itself as a coremod, perhaps because Forge once didn’t(just a wild guess on why), then after, Forge tries to instantiate it. Take a look at the thread dumps.
The first dump
The second dump

(Side note, including links to crash reports and logs shouldn’t get my posts “flagged by multiple community members” to be hidden. I got a notification saying the links were why they got hidden.)

EDIT: Thanks JBYoshi for fixing that.
Also, I’ve kept looking since posting this, but still haven’t figured out why it is instantiating twice.

I unhid the external links for you and bumped your internal status early so it shouldn’t happen again.

1 Like

I have found why Sponge is getting instantiated twice, but not a solution. It is something in the mixin jar:
org.spongepowered.asm.launch.platform.MixinPlatformAgentFML line 170:
ITweaker wrapper = (ITweaker)mdLoadCoreMod.invoke(null, Launch.classLoader, coreModName, this.container);
This is calling loadCoreMod when Sponge is being instantiated. loadCoreMod creates a new instance of SpongeCoremod.

Anyone know how I can fix this? I still haven’t made any progress.

Hmm, try adding --noCoreSearch to the launch arguments.

1 Like

Well, that got it to load without crashing, but it had side effects. Currently, my game looks like this, I suppose I’ll have to manually add each coremod that would be covered by the search.
EDIT: You can’t see in the screenshot too well, but that square is the main menu animation. No buttons or anything like that loaded.

After manually making the sponge coremod load, it crashed with the same crash again. Without the coremod loaded, even when adding everything else(I think I got it all) using program arguments, the window looked like the above screenshot(after expanding, before expanding it, it was like the below image)

Should I just file a bug report on GitHub about this? It seems to me like this is a SpongeForge issue, not an issue with how I’m doing things, since I haven’t gotten a working response on how to fix it.