Package com.plotsquared.core.events
Class PlotChangeOwnerEvent
java.lang.Object
com.plotsquared.core.events.PlotEvent
com.plotsquared.core.events.PlotChangeOwnerEvent
- All Implemented Interfaces:
CancellablePlotEvent
-
Constructor Summary
ConstructorDescriptionPlotChangeOwnerEvent
(PlotPlayer<?> initiator, Plot plot, @Nullable UUID oldOwner, @Nullable UUID newOwner, boolean hasOldOwner) PlotChangeOwnerEvent: Called when a plot's owner is change. -
Method Summary
Modifier and TypeMethodDescriptionPlotPlayer<?>
Get the change-owner initiatorGet the new owner of the plotGet the old owner of the plot.Get the PlotId.getWorld()
Get the world name.boolean
Get if the plot had an old ownervoid
void
setNewOwner
(@Nullable UUID newOwner) Set the new owner of the plot.Methods inherited from class com.plotsquared.core.events.PlotEvent
getEventName, getPlot
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.plotsquared.core.events.CancellablePlotEvent
getEventResultRaw
-
Constructor Details
-
PlotChangeOwnerEvent
public PlotChangeOwnerEvent(PlotPlayer<?> initiator, Plot plot, @Nullable UUID oldOwner, @Nullable UUID newOwner, boolean hasOldOwner) PlotChangeOwnerEvent: Called when a plot's owner is change.- Parameters:
initiator
- The player attempting to set the plot's ownerplot
- The plot having its owner changedoldOwner
- The old owner of the plot or nullnewOwner
- The new owner of the plot or nullhasOldOwner
- If the plot has an old owner
-
-
Method Details
-
getPlotId
Get the PlotId.- Returns:
- PlotId
-
getWorld
Get the world name.- Returns:
- String
-
getInitiator
Get the change-owner initiator- Returns:
- Player
-
getOldOwner
Get the old owner of the plot. Null if not exists.- Returns:
- UUID
-
getNewOwner
Get the new owner of the plot- Returns:
- UUID
-
setNewOwner
Set the new owner of the plot. Null for no owner.- Parameters:
newOwner
- the new owner or null
-
hasOldOwner
public boolean hasOldOwner()Get if the plot had an old owner- Returns:
- boolean
-
getEventResult
- Specified by:
getEventResult
in interfaceCancellablePlotEvent
-
setEventResult
- Specified by:
setEventResult
in interfaceCancellablePlotEvent
-