Package net.minecraftforge.event
Class AddReloadListenerEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.AddReloadListenerEvent
public class AddReloadListenerEvent
extends net.minecraftforge.eventbus.api.Event
The main ResourceManager is recreated on each reload, just after
ReloadableServerResources
's creation.
The event is fired on each reload and lets modders add their own ReloadListeners, for server-side resources.
The event is fired on the MinecraftForge.EVENT_BUS
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<PreparableReloadListener>
private final RegistryAccess
private final ReloadableServerResources
-
Constructor Summary
ConstructorDescriptionAddReloadListenerEvent
(ReloadableServerResources serverResources, RegistryAccess registryAccess) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PreparableReloadListener listener) This context object holds data relevant to the current reload, such as staged tags.Provides access to the loaded registries associated with these server resources.Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
listeners
-
serverResources
-
registryAccess
-
-
Constructor Details
-
AddReloadListenerEvent
public AddReloadListenerEvent(ReloadableServerResources serverResources, RegistryAccess registryAccess)
-
-
Method Details
-
addListener
- Parameters:
listener
- the listener to add to the ResourceManager on reload
-
getListeners
-
getServerResources
- Returns:
- The ReloableServerResources being reloaded.
-
getConditionContext
This context object holds data relevant to the current reload, such as staged tags.- Returns:
- The condition context for the currently active reload.
-
getRegistryAccess
Provides access to the loaded registries associated with these server resources. All built-in and dynamic registries are loaded and frozen by this point.- Returns:
- The RegistryAccess context for the currently active reload.
-