类 DominionModifyEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.modify.DominionModifyEvent
所有已实现的接口:
org.bukkit.event.Cancellable
直接已知子类:
DominionRenameEvent, DominionReSizeEvent, DominionSetEnvFlagEvent, DominionSetGuestFlagEvent, DominionSetMapColorEvent, DominionSetMessageEvent, DominionSetOwnerGlowEvent, DominionSetTpLocationEvent, DominionTransferEvent

public class DominionModifyEvent extends ResultEvent
Event triggered when a Dominion is modified in the Dominion system.
  • 构造器详细资料

    • DominionModifyEvent

      public DominionModifyEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion)
      Constructs a new DominionModifyEvent.
      参数:
      operator - the command sender who initiated the event
      dominion - the dominion being modified
  • 方法详细资料

    • 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 modified, you should use the afterModified(Consumer) method instead.

      返回:
      the CompletableFuture to be completed
    • afterModified

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

      Use this method to perform actions after the dominion has been modified.

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

      @NotNull public @NotNull DominionDTO getDominion()
      Returns the dominion to be modified.

      This method retrieves the dominion that is going to be modified by this event. To get the modified dominion after the event is processed, use the afterModified(Consumer) method to register a callback.

      返回:
      the dominion
    • setDominion

      public void setDominion(@NotNull @NotNull DominionDTO dominion)
      Sets the dominion to be modified.

      This method can only change which dominion will be modified.

      参数:
      dominion - the dominion to set