Class GroupRemoveMemberEvent

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

public class GroupRemoveMemberEvent extends ResultEvent
Event triggered when a member is removed from a group of a dominion.
  • Constructor Details

    • GroupRemoveMemberEvent

      public GroupRemoveMemberEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull GroupDTO group, @NotNull @NotNull MemberDTO member)
      Constructs a new GroupRemoveMemberEvent.
      Parameters:
      operator - the command sender who initiated the event
      dominion - the dominion associated with the event
      group - the group from which the member is removed
      member - the member being removed
  • Method Details

    • getGroup

      @NotNull public @NotNull GroupDTO getGroup()
      Returns the group from which the member is removed.
      Returns:
      the group
    • getMember

      @NotNull public @NotNull MemberDTO getMember()
      Returns the member being removed.
      Returns:
      the member
    • getDominion

      @NotNull public @NotNull DominionDTO getDominion()
      Returns the dominion associated with the event.
      Returns:
      the dominion
    • setMember

      public void setMember(@NotNull @NotNull MemberDTO member)
      Sets the member being removed.
      Parameters:
      member - the new member
    • getFutureToComplete

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

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

      Returns:
      the CompletableFuture to be completed
    • afterAdded

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

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

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