Immersive Engineering

Immersive Engineering

134M Downloads

[1.16.4] Unthreadsafe registration of JigsawPatterns can cause exceptions in modpacks

Commoble opened this issue ยท 0 comments

commented

Before reporting:

  • Searched issues for "jigsaw" and "village"

Description of the issue:

ImmersiveEngineering#setup(FMLCommonSetupEvent) calls this
https://github.com/BluSunrize/ImmersiveEngineering/blob/1.16.4/src/main/java/blusunrize/immersiveengineering/ImmersiveEngineering.java#L207
which calls this
https://github.com/BluSunrize/ImmersiveEngineering/blob/1.16.4/src/main/java/blusunrize/immersiveengineering/common/IEContent.java#L835
which calls this
https://github.com/BluSunrize/ImmersiveEngineering/blob/1.16.4/src/main/java/blusunrize/immersiveengineering/common/world/Villages.java#L106

Here, JigsawPatterns are registered to the vanilla Registry during multithreaded modloading; this can cause race conditions and random and hard-to-reproduce crashes when done alongside other mods that are doing the same thing. This registration can be done safely by doing so via DeferredWorkQueue or event::enqueueWork

Crashlog:

Crash Log
https://gist.github.com/Yourname942/242e10837c171c24704c60a82e352990#file-crash-log-1-6-21-7-12pm-L49
Latest Log
https://gist.github.com/Yourname942/23cc52cd6ffbe875b99304e110fdc78e

Versions & Modlist

ImmersiveEngineering-1.16.4-4.1.2-129
Forge: net.minecraftforge:35.1.29