类 MemberAddedEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.member.MemberAddedEvent
所有已实现的接口:
org.bukkit.event.Cancellable

public class MemberAddedEvent extends ResultEvent
Event triggered when a member is added to a Dominion.
  • 构造器详细资料

    • MemberAddedEvent

      public MemberAddedEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull PlayerDTO player)
      Constructs a new MemberAddedEvent.
      参数:
      operator - the command sender who initiated the event
      dominion - the dominion to which the member is added
      player - the player who is adding the member
  • 方法详细资料

    • setDominion

      public void setDominion(@NotNull @NotNull DominionDTO dominion)
      Sets the dominion.
      参数:
      dominion - the dominion to set
    • getDominion

      @NotNull public @NotNull DominionDTO getDominion()
      Gets the dominion.
      返回:
      the dominion
    • setPlayer

      public void setPlayer(@NotNull @NotNull PlayerDTO player)
      Sets the player.
      参数:
      player - the player to set
    • getPlayer

      @NotNull public @NotNull PlayerDTO getPlayer()
      Gets the player.
      返回:
      the player
    • getFutureToComplete

      public CompletableFuture<MemberDTO> getFutureToComplete()
      Gets the CompletableFuture that will be completed with the added MemberDTO.

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

      返回:
      the CompletableFuture to be completed
    • afterAdded

      public CompletableFuture<Void> afterAdded(Consumer<MemberDTO> consumer)
      Call back after the member is added.

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

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

      @Deprecated(since="4.6.0", forRemoval=true) public void setMember(@Nullable @Nullable MemberDTO member)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Sets the newly added member.
      参数:
      member - the newly added member
    • getMember

      @Deprecated(since="4.6.0", forRemoval=true) @Nullable public @Nullable MemberDTO getMember()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Gets the newly added member. If there is none, returns null. Only has a value if the addition was successful.
      返回:
      the newly added member, or null if none