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

public class ClaimCreateEvent extends CustomEvent implements 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.

  • Constructor Details

    • ClaimCreateEvent

      public ClaimCreateEvent(@NotNull @NotNull List<@NotNull Claim> claims)
      Constructs a new ClaimCreateEvent for multiple claims.
      Parameters:
      claims - the claims that are about to be created
    • ClaimCreateEvent

      public ClaimCreateEvent(@NotNull @NotNull Claim claim)
      Constructs a new ClaimCreateEvent for a claim.
      Parameters:
      claim - the claim that is about to be created
  • Method Details

    • getClaims

      @NotNull public @NotNull com.google.common.collect.ImmutableList<@NotNull Claim> getClaims()
      Gets an immutable list of claims being created.
      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().

      Returns:
      the first claim in the list
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • 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