Package io.papermc.paper.registry.event
Interface RegistryEventProvider<T,B extends RegistryBuilder<T>>
- Type Parameters:
T- registry entry typeB- registry entry builder type
@Experimental
@NullMarked
@NonExtendable
public interface RegistryEventProvider<T,B extends RegistryBuilder<T>>
Provider for registry events for a specific registry.
Supported events are:
RegistryEntryAddEvent(viaentryAdd())RegistryFreezeEvent(viafreeze())
-
Method Summary
Modifier and TypeMethodDescriptionentryAdd()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.Gets the registry key associated with this event type provider.
-
Method Details
-
entryAdd
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
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
RegistryKey<T> registryKey()Gets the registry key associated with this event type provider.- Returns:
- the registry key
-