Class ClaimCreateEvent
java.lang.Object
org.bukkit.event.Event
net.mathias2246.buildmc.api.event.CustomEvent
net.mathias2246.buildmc.api.event.claims.ClaimCreateEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Called when one or more claims are created.
This event is fired synchronously on the main server thread. If the event is cancelled, none of the claims should be created.
-
Nested Class Summary
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
ConstructorsConstructorDescriptionClaimCreateEvent(@NotNull List<@NotNull Claim> claims) Constructs a newClaimCreateEventfor multiple claims.ClaimCreateEvent(@NotNull Claim claim) Constructs a newClaimCreateEventfor a claim. -
Method Summary
Modifier and TypeMethodDescription@NotNull ClaimgetClaim()Convenience method for single-claim operations.@NotNull com.google.common.collect.ImmutableList<@NotNull Claim> Gets an immutable list of claims being created.static @NotNull org.bukkit.event.HandlerListRequired by the Bukkit event system for registration.@NotNull org.bukkit.event.HandlerListReturns theHandlerListfor this event type.booleanvoidsetCancelled(boolean cancel) Methods inherited from class CustomEvent
getMetadata, putMetadata, removeMetadataMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ClaimCreateEvent
Constructs a newClaimCreateEventfor multiple claims.- Parameters:
claims- the claims that are about to be created
-
ClaimCreateEvent
Constructs a newClaimCreateEventfor a claim.- Parameters:
claim- the claim that is about to be created
-
-
Method Details
-
getClaims
Gets an immutable list of claims being created.- Returns:
- all claims included in this creation operation
-
getClaim
Convenience method for single-claim operations.If multiple claims are present, this returns the first one. Plugins that care about bulk operations (BulkMC-Core xD) should use
getClaims().- Returns:
- the first claim in the list
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
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
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Required by the Bukkit event system for registration.- Returns:
- the static handler list
-