Random mod loading order sometimes causes the screen to not open when using an ExtendedScreenHandlerType
Leximon opened this issue ยท 0 comments
This is the part of the code that's causing this issue:
https://github.com/FabricMC/fabric/blob/e9d2a72b4f1ba820c88830c84e199b07b05f4ae9/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/impl/screenhandler/Networking.java#L84C1-L88C6
When the Fabric API initializes after a mod registered its (extended) screen handler, the packet codec will not be put into the CODEC_BY_ID
map because the callback hasn't been registered yet.
One possible solution might be to create a new callback that's executed before the registry freezes to foreach all entries that are an instance of ExtendedScreenHandlerType.
Using Fabric 0.96.12+1.20.5