Class MemberAddedEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.member.MemberAddedEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Event triggered when a member is added to a Dominion.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionMemberAddedEvent
(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull PlayerDTO player) Constructs a new MemberAddedEvent. -
Method Summary
Modifier and TypeMethodDescriptionafterAdded
(Consumer<MemberDTO> consumer) Call back after the member is added.@NotNull DominionDTO
Gets the dominion.Gets the CompletableFuture that will be completed with the added MemberDTO.@Nullable MemberDTO
Deprecated, for removal: This API element is subject to removal in a future version.@NotNull PlayerDTO
Gets the player.void
setDominion
(@NotNull DominionDTO dominion) Sets the dominion.void
Deprecated, for removal: This API element is subject to removal in a future version.void
Sets the player.Methods inherited from class cn.lunadeer.dominion.events.ResultEvent
getOperator, isCancelled, setCancelled
Methods inherited from class cn.lunadeer.dominion.events.CallableEvent
call, getHandlerList, getHandlers
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
MemberAddedEvent
public MemberAddedEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull PlayerDTO player) Constructs a new MemberAddedEvent.- Parameters:
operator
- the command sender who initiated the eventdominion
- the dominion to which the member is addedplayer
- the player who is adding the member
-
-
Method Details
-
setDominion
Sets the dominion.- Parameters:
dominion
- the dominion to set
-
getDominion
Gets the dominion.- Returns:
- the dominion
-
setPlayer
Sets the player.- Parameters:
player
- the player to set
-
getPlayer
Gets the player.- Returns:
- the player
-
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.- Returns:
- the CompletableFuture to be completed
-
afterAdded
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.
- Parameters:
consumer
- the consumer to handle the created member- Returns:
- 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) Deprecated, for removal: This API element is subject to removal in a future version.Sets the newly added member.- Parameters:
member
- the newly added member
-
getMember
Deprecated, for removal: This API element is subject to removal in a future version.Gets the newly added member. If there is none, returns null. Only has a value if the addition was successful.- Returns:
- the newly added member, or null if none
-