Interface RegistryEntryAddConfiguration<T>
- Type Parameters:
T
- registry entry type
- All Superinterfaces:
LifecycleEventHandlerConfiguration<BootstrapContext>
,PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext>
public interface RegistryEntryAddConfiguration<T>
extends PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext>
Specific configuration for
RegistryEntryAddEvent
s.-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull RegistryEntryAddConfiguration
<T> Only call the handler if the value being added matches the specified key.@NonNull RegistryEntryAddConfiguration
<T> Only call the handler if the value being added passes the provided filter.@NonNull RegistryEntryAddConfiguration
<T> monitor()
Sets this handler configuration to be considered a "monitor".@NonNull RegistryEntryAddConfiguration
<T> priority
(int priority) Sets the priority for this handler.
-
Method Details
-
filter
@Contract(value="_ -> this", mutates="this") default @NonNull RegistryEntryAddConfiguration<T> filter(@NonNull 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") @NonNull RegistryEntryAddConfiguration<T> filter(@NonNull 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
@NonNull 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
-