SpongeForge crash on FTB Unstable with Forge 1732

I’m trying to use the FTB Unstable modpack (with the client mods removed, obviously) on Forge Server 1732 and the server is crashing with SpongeForge in the mods folder.

Crash report: gist:fa08dfdd69014249f5f3 · GitHub

The problem appears to be something calling “onUpdateWeatherBody”, but I’m not a Java dev and I know little about this.

Thanks for your help :slightly_smiling:

Just guessing here. But I think a mod also manipulated the code, and sponge (aka mixins) got confused. The only way to fix this would possible altering the injection code, so it doesn’t get confused :confused:.

Any way to tell which mod might be at fault?

Well only coremods can modify the bytecode at runtime.
As far I can see only these mods are coremods, but that doesn’t exactly mean that they alter the code.

  • DynamicSurroundings-1.8.9-2.0.3.2.jar
  • FastLeafDecay-1.8-1.6.jar
  • hopperducts-mc1.8.8-1.4.6.jar
  • RandomThings-MC1.8.9-3.6.2.jar
  • Thaumcraft-1.8.9-5.1.6.jar
  • ThaumicInfusion-1.8.9-4.8.jar

Altrough this line:

[08:38:33] [main/INFO] [TI Transformer/]: Thaumic Infusion has detected an Obfuscated environment!

Gives away a clue that Thaumic infusion is altering the code.

Aha! The problem was DynamicSurroundings, which modifies the vanilla storms with variable intensities. That explains the “onUpdateWeatherBody” error.

Now I’m getting a crash with PneumaticCraft generating oil: gist:65145602dc6175478da4 · GitHub

But I guess I need to report this to the mod author.

Thank you so much for your help, you saved me from a lot of mod testing!

Yes. Dynamic Surroundings injects code into World for hooking weather effects. The transform hook can be found here. To sum up it guts the World method and redirects to a static method within the Dynamic Surroundings mod. Short of gutting a feature out of the mod I am unsure how to fix. Any suggestions from the Sponge side of things?

There’s a few possible solutions:

  • The mod developer simply injects a return after his method and doesn’t clear out the rest of the method itself (Mixins does have this capability and Sponge uses it in a few places to avoid incompatibilities with other mods)
  • Sponge can perform force checks when setThundering(Z) or setRaining(Z) is called instead of trying to hook into the current method (it’d be a workaround from us, but it’s not opportune imo)
  • The mod developer can rewrite his transformer to use Mixins and write an injection at HEAD that is cancellable = true and call the sponge related method if Sponge is installed to ensure our API doesn’t break.

A few other ideas are possible, but the way his transformer is just dumping a method entirely is definitely the problem here.

Forge 1.8.9 have mixin support without Sponge? Otherwise I can modify based on the first bullet.

If Forge didn’t support mixins in 1.8.9, then SpongeForge wouldn’t be on 1.8.9 ;). Adding mixins is actually quite easy as exemplified here. What I was mentioning for injecting and cancelling a return would be similar to this. Hell, to call the sponge related methods, you could very well even write a MixinPlugin that will optionally add a mixin to whatever class you need (I’m guessing WorldHandler in this case) to call the org.spongepowered.api.world.World methods) which guarantees SpongeAPI plugins don’t end up breaking (and we can throw the proper events regardless).

Very nice. I much prefer mixins rather than doing all this ASM stuff.

I wonder wouldn’t coremods benefit from using mixins instead? Than we are sure they are 100% sponge compatible. Of Course that wouldn’t work if the mixintweaker can only support 1 mixin / class. I vote for mixins in forge :stuck_out_tongue:.

Sadly enough it only works on coremods tho :frowning:. I did something similar with mixins here. And had to convert normal mods to coremods.

Sure, while mixins only work on core mods, that’s what multiphase is targeting for. When it’s completed, Mixins will be able to target non-core mods as well.

Most core mods would benefit from using Mixins, but it’s ultimately up to the mod developer to invest the time to rewrite their transformer code to use Mixins.

1 Like

FYI - doing the quick fix for the next release of Dynamic Surroundings 1.8.9-2.0.4.10 (i.e. inserting the code at the top without removing the rest of the method body). For the next major release cycle I plan on trying out the Mixin library.

4 Likes

It’s nice to meet a mod author as productive as yourself. Most of the time when I report an issue like this, the author just blames other people and never fixes the issue, or takes a year to do so :slightly_smiling:

1 Like

Build 1.8.9-2.0.4.10 has been posted to CurseForge. Should be compatible with SpongeForge. If you have any problems let me know.

2 Likes