Class PlotChangeOwnerEvent

java.lang.Object
com.plotsquared.core.events.PlotEvent
com.plotsquared.core.events.PlotChangeOwnerEvent
All Implemented Interfaces:
CancellablePlotEvent

public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEvent
  • 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 owner
      plot - The plot having its owner changed
      oldOwner - The old owner of the plot or null
      newOwner - The new owner of the plot or null
      hasOldOwner - If the plot has an old owner
  • Method Details

    • getPlotId

      public PlotId getPlotId()
      Get the PlotId.
      Returns:
      PlotId
    • getWorld

      public String getWorld()
      Get the world name.
      Returns:
      String
    • getInitiator

      public PlotPlayer<?> getInitiator()
      Get the change-owner initiator
      Returns:
      Player
    • getOldOwner

      public @Nullable UUID getOldOwner()
      Get the old owner of the plot. Null if not exists.
      Returns:
      UUID
    • getNewOwner

      public @Nullable UUID getNewOwner()
      Get the new owner of the plot
      Returns:
      UUID
    • setNewOwner

      public void setNewOwner(@Nullable UUID newOwner)
      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

      public Result getEventResult()
      Specified by:
      getEventResult in interface CancellablePlotEvent
    • setEventResult

      public void setEventResult(Result e)
      Specified by:
      setEventResult in interface CancellablePlotEvent