Class MemberRemovedEvent

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

public class MemberRemovedEvent extends ResultEvent
Event triggered when a member is removed from a Dominion.

This event is triggered when a player removes a member.

  • Constructor Details

    • MemberRemovedEvent

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

    • setDominion

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

      @NotNull public @NotNull DominionDTO getDominion()
      Gets the dominion.
      Returns:
      the dominion
    • setMember

      public void setMember(@NotNull @NotNull MemberDTO member)
      Sets the member.
      Parameters:
      member - the member to set
    • getMember

      @NotNull public @NotNull MemberDTO getMember()
      Gets the member.
      Returns:
      the 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 afterRemoved(Consumer) method instead.

      Returns:
      the CompletableFuture to be completed
    • afterRemoved

      public CompletableFuture<Void> afterRemoved(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 removed member
      Returns:
      a CompletableFuture that completes when the consumer has been executed