BluSunrize / ImmersiveEngineering

Wires, transformers, high voltage! Bzzzzt!
Other
789 stars 393 forks source link

Fix crash due to empty array #6036

Closed AmmoniumX closed 2 months ago

AmmoniumX commented 3 months ago

This patch fixes https://github.com/BluSunrize/ImmersiveEngineering/issues/5290 , where the game will crash due to empty array passed to getPreferredStackbyMod.

The change is really simple, just by throwing an exception earlier in the chain, minecraft's server init logic is able to catch it and keep running. I'm not really 100% sure of the reason why, I just know that it works

This fix is particularly important for the pack I have recently released, Forever Factory, since it will always crash on world creation with the "Skyblock" preset, where with this patch, it never crashes.

Steps to verify the PR fix:

  1. Download Forever Factory
  2. Create new world, select "Skyblock" on world type
  3. Observe the crash
  4. Replace the IE jar with one compiled with this PR
  5. Create new world again
  6. World generates without crashing client

I am not sure if 1.19.2 is still supported, but I hope an exception can be made to fix this critical issue that strongly affects my modpack.

I am also open to further change requests if this PR is not satisfactory.

Have a nice day :)