Interface RegistryEntryAddConfiguration<T>
- Type Parameters:
T
- registry entry type
- All Superinterfaces:
LifecycleEventHandlerConfiguration<BootstrapContext>
,PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext>
@NullMarked
public interface RegistryEntryAddConfiguration<T>
extends PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext>
Specific configuration for
RegistryEntryAddEvent
s.-
Method Summary
Modifier and TypeMethodDescriptiondefault RegistryEntryAddConfiguration
<T> Only call the handler if the value being added matches the specified key.Only call the handler if the value being added passes the provided filter.monitor()
Sets this handler configuration to be considered a "monitor".priority
(int priority) Sets the priority for this handler.
-
Method Details
-
filter
@Contract(value="_ -> this", mutates="this") default RegistryEntryAddConfiguration<T> filter(TypedKey<T> key) Only call the handler if the value being added matches the specified key.- Parameters:
key
- the key to match- Returns:
- this configuration
-
filter
@Contract(value="_ -> this", mutates="this") RegistryEntryAddConfiguration<T> filter(Predicate<TypedKey<T>> filter) Only call the handler if the value being added passes the provided filter.- Parameters:
filter
- the predicate to match the key against- Returns:
- this configuration
-
priority
Description copied from interface:PrioritizedLifecycleEventHandlerConfiguration
Sets the priority for this handler. Resets all previous calls toPrioritizedLifecycleEventHandlerConfiguration.monitor()
. A lower numeric value correlates to the handler being run earlier.- Specified by:
priority
in interfacePrioritizedLifecycleEventHandlerConfiguration<T>
- Parameters:
priority
- the numerical priority- Returns:
- this configuration for chaining
-
monitor
RegistryEntryAddConfiguration<T> monitor()Description copied from interface:PrioritizedLifecycleEventHandlerConfiguration
Sets this handler configuration to be considered a "monitor". These handlers will run last and should only be used by plugins to observe any changes from previously ran handlers.- Specified by:
monitor
in interfacePrioritizedLifecycleEventHandlerConfiguration<T>
- Returns:
- this configuration for chaining
-