ItemPropertiesRegistry.register calls the vanilla ItemProperties.register, which does computeIfAbsent on a static HashMap, which is not thread safe.
When calling it from CLIENT_SETUP which is called from the parallel executing FMLClientSetupEvent, there can be read/write conflicts with other mods and result in ConcurrentModificationException.
This is not an issue on Fabric since it doesn't execute entry point functions in multiple threads.
Is this an Architectury API issue, or if I should call ItemPropertiesRegistry.register from somewhere else?
I've read the Architectury API documentation didn't notice entries mentioning thread safety.
Oh yeah, my game just crashed because of this.
"Architectury encountered an error during the common_stup event phase"
java.util.ConcurrentModificationException: null
ItemPropertiesRegistry.register
calls the vanillaItemProperties.register
, which doescomputeIfAbsent
on a static HashMap, which is not thread safe. When calling it fromCLIENT_SETUP
which is called from the parallel executingFMLClientSetupEvent
, there can be read/write conflicts with other mods and result inConcurrentModificationException
.This is not an issue on Fabric since it doesn't execute entry point functions in multiple threads.
Is this an Architectury API issue, or if I should call
ItemPropertiesRegistry.register
from somewhere else? I've read the Architectury API documentation didn't notice entries mentioning thread safety.