Class DominionModifyEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.modify.DominionModifyEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
DominionRenameEvent,DominionReSizeEvent,DominionSetEnvFlagEvent,DominionSetGuestFlagEvent,DominionSetMapColorEvent,DominionSetMessageEvent,DominionSetTpLocationEvent,DominionTransferEvent
Event triggered when a Dominion is modified in the Dominion system.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionDominionModifyEvent(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion) Constructs a new DominionModifyEvent. -
Method Summary
Modifier and TypeMethodDescriptionafterModified(Consumer<DominionDTO> consumer) Call back after the dominion is modified.@NotNull DominionDTOReturns the dominion to be modified.Gets the CompletableFuture that will be completed with the created DominionDTO.voidsetDominion(@NotNull DominionDTO dominion) Sets the dominion to be modified.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
-
DominionModifyEvent
public DominionModifyEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion) Constructs a new DominionModifyEvent.- Parameters:
operator- the command sender who initiated the eventdominion- the dominion being modified
-
-
Method Details
-
getFutureToComplete
Gets the CompletableFuture that will be completed with the created DominionDTO.Under most circumstances, you should not need to use this method directly. If you need to perform actions after the dominion is modified, you should use the
afterModified(Consumer)method instead.- Returns:
- the CompletableFuture to be completed
-
afterModified
Call back after the dominion is modified.Use this method to perform actions after the dominion has been modified.
- Parameters:
consumer- the consumer to handle the created dominion- Returns:
- a CompletableFuture that completes when the consumer has been executed
-
getDominion
Returns the dominion to be modified.This method retrieves the dominion that is going to be modified by this event. To get the modified dominion after the event is processed, use the
afterModified(Consumer)method to register a callback.- Returns:
- the dominion
-
setDominion
Sets the dominion to be modified.This method can only change which dominion will be modified.
- Parameters:
dominion- the dominion to set
-