Class ClaimRegisteredEvent
This event is fired synchronously on the main server thread, after the
claims have been persisted. Because the claims have already been persisted,
Claim.getId() is guaranteed to return a non-null value for
every claim in this event.
This event is not cancellable, as the claims have already been created by
the time it is fired. To prevent claims from being created, cancel
ClaimCreateEvent instead.
- See Also:
-
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
ConstructorsConstructorDescriptionClaimRegisteredEvent(@NotNull List<@NotNull Claim> claims) Constructs a newClaimRegisteredEventfor multiple claims.ClaimRegisteredEvent(@NotNull Claim claim) Constructs a newClaimRegisteredEventfor 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 that were created.static @NotNull org.bukkit.event.HandlerListRequired by the Bukkit event system for registration.@NotNull org.bukkit.event.HandlerListReturns theHandlerListfor this event type.Methods inherited from class CustomEvent
getMetadata, putMetadata, removeMetadataMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ClaimRegisteredEvent
Constructs a newClaimRegisteredEventfor multiple claims.- Parameters:
claims- the claims that have just been created. Note thatClaim.getId()is guaranteed to be non-nullfor each of these, as they have already been persisted.
-
ClaimRegisteredEvent
Constructs a newClaimRegisteredEventfor a claim.- Parameters:
claim- the claim that has just been created. Note thatClaim.getId()is guaranteed to be non-null, as it has already been persisted.
-
-
Method Details
-
getClaims
Gets an immutable list of claims that were created.As these claims have already been persisted to the database,
Claim.getId()is guaranteed to return a non-nullvalue for each of them.- 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().As with
getClaims(), the returned claim has already been persisted, soClaim.getId()is guaranteed to be non-null.- Returns:
- the first claim in the list
-
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
-