Class ClaimWhitelistChangeEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Claim is about to change.
This event is fired before the whitelist is actually updated. It is cancellable, allowing other plugins to prevent the whitelist change from occurring.
This event is called when a plugin, or player adds or removes a member from the whitelist of a claim.
If this event is cancelled, the whitelist will remain unchanged.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines which action was applied on the whitelist.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class CustomEvent
metadataHolder -
Constructor Summary
ConstructorsConstructorDescriptionClaimWhitelistChangeEvent(@NotNull Claim claim, @NotNull org.bukkit.OfflinePlayer whitelistedPlayer, @NotNull ClaimWhitelistChangeEvent.ChangeAction action) The default constructor for creating this event. -
Method Summary
Modifier and TypeMethodDescriptionGets the kind of action that will be used on the player in the whitelist.@NotNull ClaimgetClaim()Gets the claim where the whitelist is about to be changed.static org.bukkit.event.HandlerListGets the static list of handlers for this event type.@NotNull org.bukkit.event.HandlerListReturns theHandlerListfor this event type.longGets when the change occurred.@NotNull org.bukkit.OfflinePlayerGets the player that is about to be added or removed from the whitelist depending on the action.booleanIf the action of this event isClaimWhitelistChangeEvent.ChangeAction.ADDED.booleanGets the cancellation state of this event.booleanIf the action of this event isClaimWhitelistChangeEvent.ChangeAction.REMOVED.voidsetCancelled(boolean b) Sets the cancellation state of this event.Methods inherited from class CustomEvent
getMetadata, putMetadata, removeMetadataMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ClaimWhitelistChangeEvent
public ClaimWhitelistChangeEvent(@NotNull @NotNull Claim claim, @NotNull @NotNull org.bukkit.OfflinePlayer whitelistedPlayer, @NotNull @NotNull ClaimWhitelistChangeEvent.ChangeAction action) The default constructor for creating this event.- Parameters:
claim- The claim where the whitelist is about to be changed.whitelistedPlayer- The player that will be added or removed from the whitelist depending on the action.action- The action that will be used on the player in the whitelist
-
-
Method Details
-
getAction
Gets the kind of action that will be used on the player in the whitelist. -
getWhitelistedPlayer
@NotNull public @NotNull org.bukkit.OfflinePlayer getWhitelistedPlayer()Gets the player that is about to be added or removed from the whitelist depending on the action.A player must not be online to be added or removed from the whitelist.
-
getClaim
Gets the claim where the whitelist is about to be changed. -
getTimestamp
public long getTimestamp()Gets when the change occurred. -
isAddedAction
public boolean isAddedAction()If the action of this event isClaimWhitelistChangeEvent.ChangeAction.ADDED.- See Also:
-
isRemovedAction
public boolean isRemovedAction()If the action of this event isClaimWhitelistChangeEvent.ChangeAction.REMOVED.- See Also:
-
isCancelled
public boolean isCancelled()Gets the cancellation state of this event.If this event is cancelled, the whitelist will remain unchanged.
- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- If this event is cancelled
-
setCancelled
public void setCancelled(boolean b) Sets the cancellation state of this event.If this event is cancelled, the whitelist will remain unchanged.
- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
b- If the event should be cancelled or not
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:CustomEventReturns theHandlerListfor this event type.Bukkit requires each concrete event class to define its own static
HandlerListinstance and to return it from this method. This is necessary for Bukkitâs event registration and dispatch system.- Specified by:
getHandlersin classCustomEvent- Returns:
- the handler list for this event (never
null)
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the static list of handlers for this event type.Required by the Bukkit event system for registration.
- Returns:
- the handler list
-