Closed NormalPlayer318 closed 3 years ago
The composter recipes is saved as an Object2FloatOpenHashMap
which is not thread-safe. But adding composter recipes is running in parallel on a thread pool. So if there are so many mods adding composter recipes, once the recipe map size is exceeded, the rehash
method will be triggered and the map will be changed, causing other mods (in crash report is my mod) to make errors when adding composter recipes.
The solution is use enqueueWork
method, which will add composter recipes synchronously on the main thread after the parallel dispatch. Here is the post in Forge forum which mentions the solution.
https://forums.minecraftforge.net/topic/93016-multithreading-correctness/?do=findComment&comment=428539
So this may solve your problem.
Crash due to unknow reasons
Note that this crash does not always occur
Crash log: