SuperMartijn642 / SuperMartijn642sCoreLib

14 stars 5 forks source link

[Crash] Registries class being called at the wrong time causes cascading registry failure #16

Closed Kaleidio closed 1 year ago

Kaleidio commented 1 year ago

Version Info

Steps to Reproduce use Kaleidio's Battle Pack with the latest version and restart over and over until luck is your uncle. note the crash is uncommon due to thread racing.

NOTE: does not occur without your core nor with it below 1.1.0 (say 1.0.9). something is expecting to be called at the wrong time cause a no such method error. Forge shows an error screen instead of closing since it crashes on the registry stage.

Any registry tasks being completed by forge at the time will crash at once, since registry is multithreaded this will show multiple of similar pathtraces in "random places" in the log

Crash report (~/logs/latest.log) latest.log

Kaleidio commented 1 year ago

latest.log demonstrates "collateral crashing" of the mods Compact Machines, Supplementaries, Trash Cans, Charm Reforged, and Quark. The issue could probably be reproduced with these batch of mods alone with your newest core. However, each of their errors' path traces looks toward your Registries class in particular for whatever reason.

Kaleidio commented 1 year ago

I assume this is a bug with the brand new RegistrationHandler class provided by the core and should be looked into, would explain why previous versions behave normally as well.

SuperMartijn642 commented 1 year ago

When my Registries class gets initialized it copies all the recipe conditions from the map in Forge's CraftingHelper class. If a mod just so happens to register a recipe condition while it is copying, an error occurs and the Registries class fails to load. After that, anything referencing Registries will error as well. Since the copying of the recipe conditions is practically instant, this will happen very rarely.

It is fixed now in version 1.1.1. Thank you for reporting the crash!