Describe the bug
While reviewing logs during an update of the AllTheMods 9 Sky modpack, ModernFix intercepted an error indicating that ShetiPhianCore is calling registerReloadListener on the wrong thread.
The stack trace points to shetiphian.core.client.model.PackTextureOverrideHandler.init being called during FMLClientSetupEvent (ShetiPhianCore.clientSetup:L79). According to ModernFix documentation, resource reload listeners should not be added in FMLClientSetupEvent or FMLCommonSetupEvent because they fire in parallel with vanilla triggering the resource reload. This can lead to the listener being ignored or causing random ConcurrentModificationException crashes.
The recommended solution is to avoid using the vanilla registerReloadListener method directly and instead utilize Forge's platform-provided RegisterClientReloadListenersEvent for clients.
Additional context
- Minecraft Version: 1.20.1
- ModLoader & Version: Forge 47.4.10
- Side: Client / SinglePlayer
- ShetiPhian Core Version: 1.20.1 - 1.5
- My Mod(s) Name & Version: EnderTanks 1.5 & EnderChests 1.4
Are other mods present?
- Yes, this occurred within the AllTheMods 9 Sky modpack environment.
- Does everything work without my mods?
Yes, the warning disappears when the mods are removed.
- Have you tested with only my mods?
No, but the provided stack trace explicitly isolates the thread violation to ShetiPhianCore.clientSetup.
PasteBin or GitHub Gists links
Relevant log snippet for reference:
[10:59:30] [Worker-ResourceReload-11/ERROR]: A mod is calling registerReloadListener at the wrong time. This will cause random concurrency crashes when ModernFix is not installed. Please report this to them. If you are a modder, refer to https://github.com/embeddedt/ModernFix/wiki/registerReloadListener-called-on-wrong-thread for more information.java.lang.Exception: registerReloadListener called on wrong thread
at net.minecraft.server.packs.resources.ReloadableResourceManager.wrapMethod$zgh000$checkCallingThread:L540
at net.minecraft.server.packs.resources.ReloadableResourceManager.m_7217_(ReloadableResourceManager.java) ~[client-1.20.1-20230612.114412-srg.jar%23773!/:?]
at shetiphian.core.client.model.PackTextureOverrideHandler.init:L47
at shetiphian.core.ShetiPhianCore.clientSetup:L79
at net.minecraftforge.eventbus.EventBus.doCastFilter:L260
at net.minecraftforge.eventbus.EventBus.lambda$addListener$11:L252
at net.minecraftforge.eventbus.EventBus.post:L315
at net.minecraftforge.eventbus.EventBus.post:L296
at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent:L121
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$5:L127
Describe the bug
While reviewing logs during an update of the AllTheMods 9 Sky modpack, ModernFix intercepted an error indicating that ShetiPhianCore is calling
registerReloadListeneron the wrong thread.The stack trace points to
shetiphian.core.client.model.PackTextureOverrideHandler.initbeing called duringFMLClientSetupEvent(ShetiPhianCore.clientSetup:L79). According to ModernFix documentation, resource reload listeners should not be added inFMLClientSetupEventorFMLCommonSetupEventbecause they fire in parallel with vanilla triggering the resource reload. This can lead to the listener being ignored or causing randomConcurrentModificationExceptioncrashes.The recommended solution is to avoid using the vanilla
registerReloadListenermethod directly and instead utilize Forge's platform-providedRegisterClientReloadListenersEventfor clients.https://github.com/embeddedt/ModernFix/wiki/registerReloadListener-called-on-wrong-thread
Additional context
Are other mods present?
Yes, the warning disappears when the mods are removed.
No, but the provided stack trace explicitly isolates the thread violation to
ShetiPhianCore.clientSetup.PasteBin or GitHub Gists links
Relevant log snippet for reference: