类 DominionCreateEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.DominionCreateEvent
所有已实现的接口:
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.
  • 字段详细资料

    • world

      public org.bukkit.World world
  • 构造器详细资料

    • 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.
      参数:
      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
  • 方法详细资料

    • setSkipEconomy

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

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

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

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

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

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

      @NotNull public @NotNull org.bukkit.World getWorld()
      Gets the world where the dominion is located.
      返回:
      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.
      参数:
      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.
      返回:
      the parent dominion, or null if there is no parent
    • setParent

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

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

      public void setOwner(@NotNull @NotNull UUID owner)
      Sets the owner of the dominion.
      参数:
      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.

      返回:
      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.

      参数:
      consumer - the consumer to handle the created dominion
      返回:
      a CompletableFuture that completes when the consumer has been executed
    • getDominion

      @Deprecated(since="4.6.0", forRemoval=true) @Nullable public @Nullable DominionDTO getDominion()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      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)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      This method is deprecated and will be removed in future versions.