-
Notifications
You must be signed in to change notification settings - Fork 143
Description
From NeoForge PR#1915:
This PR introduces dependency sorting for both client and server reload listeners. The sort is topological, using FML's TopologicalSort class as the backbone. Reload listeners are added to a DAG where an edge from a->b means that a must run before b.
The sorting logic, and the modder-facing API, is in SortedReloadListenerEvent, the parent class of both AddServerReloadListenersEvent and AddClientReloadListenersEvent (formerly RegisterClientReloadListenersEvent).
Requirements
As a prerequisite, this change enforces that all reload listeners are named. The name must be provided via SortedReloadListenerEvent#addListener at the time of registration. Vanilla listeners are automatically named, via VanillaClientListeners and VanillaServerListeners, which hold the class->RL maps for all known vanilla listener types.
Note: Mods that are currently using mixins or other non-event means to inject reload listeners will crash after this change.