You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently construct mod objects "somewhere" inside of the constructor of Minecraft and recently moved the location for neoforged/NeoForge#1830
This caused unexpected issues due to shifting availability of some fields of Minecraft.
We should rip the bandaid off, so to speak, and align mod construction on clients with the approach taken on servers: Construct the mods much earlier (after bootstrap, but before any other global state is initialized), and offer events that align with the lifecycle of the "client" (==Minecraft), such as ClientStartingEvent, ClientStartedEvent, ClientStoppingEvent, ClientStoppedEvent.
Overall this makes the contract much clearer: During mod construction, Minecraft.instance is null, and the modder has to subscribe either to events they care about (same as now, such as RegisterClientReloadListenersEvent instead of accessing the resource manager directly), or subscribe to the client lifecycle events that make their contract much more explicit than now (are the fields of Minecraft initialized or not).
The text was updated successfully, but these errors were encountered:
We currently construct mod objects "somewhere" inside of the constructor of
Minecraft
and recently moved the location for neoforged/NeoForge#1830This caused unexpected issues due to shifting availability of some fields of
Minecraft
.We should rip the bandaid off, so to speak, and align mod construction on clients with the approach taken on servers: Construct the mods much earlier (after bootstrap, but before any other global state is initialized), and offer events that align with the lifecycle of the "client" (==
Minecraft
), such asClientStartingEvent
,ClientStartedEvent
,ClientStoppingEvent
,ClientStoppedEvent
.Overall this makes the contract much clearer: During mod construction,
Minecraft.instance
is null, and the modder has to subscribe either to events they care about (same as now, such asRegisterClientReloadListenersEvent
instead of accessing the resource manager directly), or subscribe to the client lifecycle events that make their contract much more explicit than now (are the fields ofMinecraft
initialized or not).The text was updated successfully, but these errors were encountered: