The ReloadListenerRegistry
class allows developers to register PreparableReloadListener
s for different PackType
s.
This method registers a `PreparableReloadListener` for the specified `PackType`. This method is not recommended since the identifier for your listener is randomly generated by Architectury, and may be hard for other mods to declare dependency on your listener.
Parameters:
type
- the PackType
for which the listener should be registered.listener
- the PreparableReloadListener
to register.
This method registers a PreparableReloadListener
for the specified PackType
and associates it with the specified listenerId
.
Parameters:
type
- the PackType
for which the listener should be registered.listener
- the PreparableReloadListener
to register.listenerId
- the ResourceLocation
to associate with the listener.
This method registers a PreparableReloadListener
for the specified PackType
, associates it with the specified listenerId
, and specifies the dependencies
of the listener.
Note: The dependencies sorting only functions on Fabric or Quilt.
Parameters:
type
- the PackType
for which the listener should be registered.listener
- the PreparableReloadListener
to register.listenerId
- the ResourceLocation
to associate with the listener.dependencies
- a collection of ResourceLocation
objects that represent the dependencies of the listener.
Here's an example of how to use the ReloadListenerRegistry
class to register a PreparableReloadListener
for the CLIENT_RESOURCES
PackType
:
public class MyReloadListener implements PreparableReloadListener { // implementation of PreparableReloadListener methods } // register the listener ReloadListenerRegistry.register(PackType.CLIENT_RESOURCES, new MyReloadListener());