Class DominionCreateEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.DominionCreateEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class DominionCreateEvent extends ResultEvent
Event triggered when a Dominion is created in the Dominion system. Setting setSkipEconomy(true) can skip the economic system processing.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.bukkit.World
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DominionCreateEvent(@NotNull org.bukkit.command.CommandSender operator, @NotNull String name, @NotNull UUID owner, @NotNull org.bukkit.World world, @NotNull CuboidDTO cuboid, @Nullable DominionDTO parent)
    Constructs a new DominionCreateEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    Call back after the dominion is created.
    @NotNull CuboidDTO
    Gets the cuboid representing the dominion's boundaries.
    @Nullable DominionDTO
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is deprecated and will be removed in future versions.
    Gets the CompletableFuture that will be completed with the created DominionDTO.
    @NotNull String
    Gets the name of the dominion.
    @NotNull UUID
    Gets the owner of the dominion.
    @Nullable DominionDTO
    Gets the parent dominion, or null if there is no parent.
    @NotNull org.bukkit.World
    Gets the world where the dominion is located.
    boolean
    Gets whether the economic system processing is skipped.
    void
    setCuboid(@NotNull CuboidDTO cuboid)
    Sets the cuboid representing the dominion's boundaries.
    void
    setDominion(@NotNull DominionDTO dominion)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is deprecated and will be removed in future versions.
    void
    setName(@NotNull String name)
    Sets the name of the dominion.
    void
    setOwner(@NotNull UUID owner)
    Sets the owner of the dominion.
    void
    setParent(@Nullable DominionDTO parent)
    Sets the parent dominion.
    void
    setSkipEconomy(boolean skipEconomy)
    Sets whether to skip the economic system processing.
    void
    setWorld(@NotNull org.bukkit.World world)
    Sets the world where the dominion is located.

    Methods inherited from class cn.lunadeer.dominion.events.ResultEvent

    getOperator, isCancelled, setCancelled

    Methods inherited from class cn.lunadeer.dominion.events.CallableEvent

    call, getHandlerList, getHandlers

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • world

      public org.bukkit.World world
  • Constructor Details

    • DominionCreateEvent

      public DominionCreateEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull String name, @NotNull @NotNull UUID owner, @NotNull @NotNull org.bukkit.World world, @NotNull @NotNull CuboidDTO cuboid, @Nullable @Nullable DominionDTO parent)
      Constructs a new DominionCreateEvent.
      Parameters:
      operator - the command sender who initiated the event
      name - the name of the dominion
      owner - the owner of the dominion
      world - the world where the dominion is located
      cuboid - the cuboid representing the dominion's boundaries
      parent - the parent dominion, or null if there is no parent
  • Method Details

    • setSkipEconomy

      public void setSkipEconomy(boolean skipEconomy)
      Sets whether to skip the economic system processing.
      Parameters:
      skipEconomy - true to skip the economic system processing, false otherwise
    • isSkipEconomy

      public boolean isSkipEconomy()
      Gets whether the economic system processing is skipped.
      Returns:
      true if the economic system processing is skipped, false otherwise
    • getName

      @NotNull public @NotNull String getName()
      Gets the name of the dominion.
      Returns:
      the name of the dominion
    • setName

      public void setName(@NotNull @NotNull String name)
      Sets the name of the dominion.
      Parameters:
      name - the name of the dominion
    • getCuboid

      @NotNull public @NotNull CuboidDTO getCuboid()
      Gets the cuboid representing the dominion's boundaries.
      Returns:
      the cuboid representing the dominion's boundaries
    • setCuboid

      public void setCuboid(@NotNull @NotNull CuboidDTO cuboid)
      Sets the cuboid representing the dominion's boundaries.
      Parameters:
      cuboid - the cuboid representing the dominion's boundaries
    • getWorld

      @NotNull public @NotNull org.bukkit.World getWorld()
      Gets the world where the dominion is located.
      Returns:
      the world where the dominion is located
    • setWorld

      public void setWorld(@NotNull @NotNull org.bukkit.World world)
      Sets the world where the dominion is located.
      Parameters:
      world - the world where the dominion is located
    • getParent

      @Nullable public @Nullable DominionDTO getParent()
      Gets the parent dominion, or null if there is no parent.
      Returns:
      the parent dominion, or null if there is no parent
    • setParent

      public void setParent(@Nullable @Nullable DominionDTO parent)
      Sets the parent dominion.
      Parameters:
      parent - the parent dominion
    • getOwner

      @NotNull public @NotNull UUID getOwner()
      Gets the owner of the dominion.
      Returns:
      the owner of the dominion
    • setOwner

      public void setOwner(@NotNull @NotNull UUID owner)
      Sets the owner of the dominion.
      Parameters:
      owner - the owner of the dominion
    • getFutureToComplete

      public CompletableFuture<DominionDTO> getFutureToComplete()
      Gets the CompletableFuture that will be completed with the created DominionDTO.

      Under most circumstances, you should not need to use this method directly. If you need to perform actions after the dominion is created, you should use the afterCreated(Consumer) method instead.

      Returns:
      the CompletableFuture to be completed
    • afterCreated

      public CompletableFuture<Void> afterCreated(Consumer<DominionDTO> consumer)
      Call back after the dominion is created.

      Use this method to perform actions after the dominion has been created (may fail), if you need to do something with the created dominion.

      Parameters:
      consumer - the consumer to handle the created dominion
      Returns:
      a CompletableFuture that completes when the consumer has been executed
    • getDominion

      @Deprecated(since="4.6.0", forRemoval=true) @Nullable public @Nullable DominionDTO getDominion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated and will be removed in future versions. To get the created dominion, use the afterCreated(Consumer) method instead.
    • setDominion

      @Deprecated(since="4.6.0", forRemoval=true) public void setDominion(@NotNull @NotNull DominionDTO dominion)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated and will be removed in future versions.