Class DominionTransferEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.modify.DominionModifyEvent
cn.lunadeer.dominion.events.dominion.modify.DominionTransferEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Event triggered when a Dominion is transferred to a new owner in the Dominion system.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionDominionTransferEvent(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull PlayerDTO newOwner) Constructs a new DominionTransferEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull PlayerDTOGets the new owner of the dominion.@NotNull PlayerDTOGets the old owner of the dominion.booleanisForce()Checks if the transfer is forced.voidsetForce(boolean force) Sets whether the transfer is forced.voidsetNewOwner(PlayerDTO newOwner) Sets the new owner of the dominion.Methods inherited from class cn.lunadeer.dominion.events.dominion.modify.DominionModifyEvent
afterModified, getDominion, getFutureToComplete, setDominionMethods 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
-
DominionTransferEvent
public DominionTransferEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull PlayerDTO newOwner) Constructs a new DominionTransferEvent.- Parameters:
operator- the command sender who initiated the eventdominion- the dominion being transferrednewOwner- the new owner of the dominion
-
-
Method Details
-
isForce
public boolean isForce()Checks if the transfer is forced.- Returns:
- true if the transfer is forced, false otherwise
-
setForce
public void setForce(boolean force) Sets whether the transfer is forced.- Parameters:
force- true to force the transfer, false otherwise
-
getNewOwner
Gets the new owner of the dominion.- Returns:
- the new owner
-
getOldOwner
Gets the old owner of the dominion.- Returns:
- the old owner
-
setNewOwner
Sets the new owner of the dominion.Changes made in
EventPriorityHIGH or higherEventHandlerwill not take effect. (Default isEventPriority.NORMAL)- Parameters:
newOwner- the new owner to set
-