Class RegistryApplyEvent<T>
java.lang.Object
org.bukkit.event.Event
com.github.darksoulq.abyssallib.server.event.custom.server.RegistryApplyEvent<T>
- Type Parameters:
T- The type of objects managed by the registries.
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class RegistryApplyEvent<T>
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Custom event triggered when a
DeferredRegistry is applied to a Registry.
This event is cancellable, allowing control over whether the registry data is applied.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionRegistryApplyEvent(@NotNull Registry<T> target, @NotNull DeferredRegistry<T> source) Constructs a newRegistryApplyEvent. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the list of handlers for this event.booleanChecks whether the event is cancelled.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.@NotNull DeferredRegistry<T> source()Gets theDeferredRegistrybeing applied.target()Gets the target registry that theDeferredRegistryis being applied to.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
RegistryApplyEvent
public RegistryApplyEvent(@NotNull @NotNull Registry<T> target, @NotNull @NotNull DeferredRegistry<T> source) Constructs a newRegistryApplyEvent.- Parameters:
target- The registry to apply the data to.source- The deferred registry to be applied.
-
-
Method Details
-
target
Gets the target registry that theDeferredRegistryis being applied to.- Returns:
- The target
Registry.
-
source
Gets theDeferredRegistrybeing applied.- Returns:
- The source
DeferredRegistry.
-
isCancelled
public boolean isCancelled()Checks whether the event is cancelled.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
trueif the event is cancelled,falseotherwise.
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel-trueto cancel the event,falseto allow it to proceed.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers for this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- The handler list.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-