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
Event triggered when a member is removed from a group of a dominion.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionGroupRemoveMemberEvent(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull GroupDTO group, @NotNull MemberDTO member) Constructs a new GroupRemoveMemberEvent. -
Method Summary
Modifier and TypeMethodDescriptionafterAdded(Consumer<MemberDTO> consumer) Registers a callback to run after the member is removed.@NotNull DominionDTOReturns the dominion associated with the event.Gets the CompletableFuture that will be completed with the removed MemberDTO.@NotNull GroupDTOgetGroup()Returns the group from which the member is removed.@NotNull MemberDTOReturns the member being removed.voidSets the member being removed.Methods inherited from class cn.lunadeer.dominion.events.ResultEvent
getOperator, isCancelled, setCancelledMethods inherited from class cn.lunadeer.dominion.events.CallableEvent
call, getHandlerList, getHandlersMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 eventdominion- the dominion associated with the eventgroup- the group from which the member is removedmember- the member being removed
-
-
Method Details
-
getGroup
Returns the group from which the member is removed.- Returns:
- the group
-
getMember
Returns the member being removed.- Returns:
- the member
-
getDominion
Returns the dominion associated with the event.- Returns:
- the dominion
-
setMember
Sets the member being removed.- Parameters:
member- the new member
-
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, use the
afterAdded(Consumer)compatibility callback instead.- Returns:
- the future; its result is the removed member, or
nullwhen the operation fails
-
afterAdded
Registers a callback to run after the member is removed.The method name is retained for API compatibility; the callback receives the removed member, or
nullwhen the operation fails.- Parameters:
consumer- the consumer to handle the removed member- Returns:
- a future that completes when the consumer has been executed
-