Class PlayerAutoPlotEvent

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

public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEvent
PlayerAutoPlotEvent returns null for PlotEvent.getPlot() as the event is fired before the plot is chosen.
  • Constructor Details

    • PlayerAutoPlotEvent

      public PlayerAutoPlotEvent(PlotPlayer<?> player, PlotArea plotArea, @Nullable String schematic, int sizeX, int sizeZ)
      PlayerAutoPlotEvent: called when a player attempts to auto claim a plot.
      Parameters:
      player - The player attempting to auto claim
      plotArea - The applicable plot area
      schematic - The schematic defined or null
      sizeX - The size of the auto area
      sizeZ - The size of the auto area
  • Method Details

    • getPlot

      public @Nullable Plot getPlot()
      Returns null as the plots to be claimed haven't been chosen yet. This will depend on the size of the auto (setSizeX(int) and setSizeZ(int)). To see which plots have been chosen, see PlayerAutoPlotsChosenEvent.
      Overrides:
      getPlot in class PlotEvent
      Returns:
      null
    • getSchematic

      public @Nullable String getSchematic()
      Obtain the schematic string as used by the Claim command or null.
      Returns:
      schematic string
    • setSchematic

      public void setSchematic(String schematic)
      Set the schematic string used in the claim.
      Parameters:
      schematic - the schematic name
    • getEventResult

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

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

      public PlotPlayer<?> getPlayer()
    • getPlotArea

      public PlotArea getPlotArea()
    • getSize_x

      @Deprecated(forRemoval=true) public int getSize_x()
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal. Use getSizeX()
    • setSize_x

      @Deprecated(forRemoval=true) public void setSize_x(int sizeX)
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal. Use setSizeX(int) )}
    • getSize_z

      @Deprecated(forRemoval=true) public int getSize_z()
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal. Use getSizeZ()
    • setSize_z

      @Deprecated(forRemoval=true) public void setSize_z(int sizeZ)
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal. Use setSizeZ(int) )}
    • getSizeX

      public int getSizeX()
      Get the x size of the auto-area
      Returns:
      x size
    • setSizeX

      public void setSizeX(int sizeX)
      Set the x size of the auto-area
      Parameters:
      sizeX - x size
    • getSizeZ

      public int getSizeZ()
      Get the z size of the auto-area
      Returns:
      z size
    • setSizeZ

      public void setSizeZ(int sizeZ)
      Set the z size of the auto-area
      Parameters:
      sizeZ - z size