Class ClaimRegisteredEvent

java.lang.Object
org.bukkit.event.Event
net.mathias2246.buildmc.api.event.CustomEvent
net.mathias2246.buildmc.api.event.claims.ClaimRegisteredEvent

public class ClaimRegisteredEvent extends CustomEvent
Called after one or more claims have been created and persisted to the database.

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:
  • Constructor Details

    • ClaimRegisteredEvent

      public ClaimRegisteredEvent(@NotNull @NotNull List<@NotNull Claim> claims)
      Constructs a new ClaimRegisteredEvent for multiple claims.
      Parameters:
      claims - the claims that have just been created. Note that Claim.getId() is guaranteed to be non-null for each of these, as they have already been persisted.
    • ClaimRegisteredEvent

      public ClaimRegisteredEvent(@NotNull @NotNull Claim claim)
      Constructs a new ClaimRegisteredEvent for a claim.
      Parameters:
      claim - the claim that has just been created. Note that Claim.getId() is guaranteed to be non-null, as it has already been persisted.
  • Method Details

    • getClaims

      @NotNull public @NotNull com.google.common.collect.ImmutableList<@NotNull Claim> 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-null value for each of them.

      Returns:
      all claims included in this creation operation
    • getClaim

      @NotNull public @NotNull Claim 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, so Claim.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: CustomEvent
      Returns the HandlerList for this event type.

      Bukkit requires each concrete event class to define its own static HandlerList instance and to return it from this method. This is necessary for Bukkit’s event registration and dispatch system.

      Specified by:
      getHandlers in class CustomEvent
      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