1mphuls3 / CreateCafe

GNU General Public License v2.0
10 stars 10 forks source link

`ConcurrentModificationException` due to non-thread-safe code ran during `FMLCommonSetupEvent` #38

Closed ChampionAsh5357 closed 2 years ago

ChampionAsh5357 commented 2 years ago

Looking at FMLCommonSetupEvent, the compostables map is updated. The map itself is a hashmap being updated during an asynchronous event. As such, a CME can be thrown if another mod, say for example, Twigs updates the compostables map at the same time.

This can be fixed by wrapping the non-thread-safe code using #enqueueWork provided by the event.

This issue was reported in the following Forge forum post.

1mphuls3 commented 2 years ago

Fixed, thanks for the help!