Package io.papermc.paper.registry.event
Interface RegistryEventProvider<T,B extends RegistryBuilder<T>>
- Type Parameters:
T- registry entry typeB- registry entry builder type
Provider for registry events for a specific registry.
Supported events are:
RegistryEntryAddEvent(viaentryAdd())RegistryFreezeEvent(viafreeze())
-
Method Summary
Modifier and TypeMethodDescription@NonNull RegistryEntryAddEventType<T, B> entryAdd()Gets the event type forRegistryEntryAddEventwhich is fired just before an object is added to a registry.freeze()Gets the event type forRegistryFreezeEventwhich is fired just before a registry is frozen.@NonNull RegistryKey<T> Gets the registry key associated with this event type provider.
-
Method Details
-
entryAdd
@NonNull RegistryEntryAddEventType<T,B> entryAdd()Gets the event type forRegistryEntryAddEventwhich is fired just before an object is added to a registry.Can be used in
LifecycleEventManager.registerEventHandler(LifecycleEventType, LifecycleEventHandler)to register a handler forRegistryEntryAddEvent.- Returns:
- the registry entry add event type
-
freeze
@NonNull LifecycleEventType.Prioritizable<BootstrapContext,RegistryFreezeEvent<T, freeze()B>> Gets the event type forRegistryFreezeEventwhich is fired just before a registry is frozen. It allows for the registration of new objects.Can be used in
LifecycleEventManager.registerEventHandler(LifecycleEventType, LifecycleEventHandler)to register a handler forRegistryFreezeEvent.- Returns:
- the registry freeze event type
-
registryKey
@NonNull RegistryKey<T> registryKey()Gets the registry key associated with this event type provider.- Returns:
- the registry key
-