Class SinglePlotManager

java.lang.Object
com.plotsquared.core.plot.PlotManager
com.plotsquared.core.plot.world.SinglePlotManager

public class SinglePlotManager extends PlotManager
  • Constructor Details

    • SinglePlotManager

      public SinglePlotManager(@NonNull PlotArea plotArea)
  • Method Details

    • getPlotIdAbs

      public PlotId getPlotIdAbs(int x, int y, int z)
      Specified by:
      getPlotIdAbs in class PlotManager
    • getPlotId

      public PlotId getPlotId(int x, int y, int z)
      Specified by:
      getPlotId in class PlotManager
    • getPlotBottomLocAbs

      public Location getPlotBottomLocAbs(@NonNull PlotId plotId)
      Specified by:
      getPlotBottomLocAbs in class PlotManager
    • getPlotTopLocAbs

      public Location getPlotTopLocAbs(@NonNull PlotId plotId)
      Specified by:
      getPlotTopLocAbs in class PlotManager
    • clearPlot

      public boolean clearPlot(@NonNull Plot plot, Runnable whenDone, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Specified by:
      clearPlot in class PlotManager
    • claimPlot

      public boolean claimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Specified by:
      claimPlot in class PlotManager
    • unClaimPlot

      public boolean unClaimPlot(@NonNull Plot plot, Runnable whenDone, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Completes block changes associated with plot unclaim.
      Specified by:
      unClaimPlot in class PlotManager
      Parameters:
      plot - plot to unclaim
      whenDone - task to run when plot is unclaimed
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • getSignLoc

      public Location getSignLoc(@NonNull Plot plot)
      Description copied from class: PlotManager
      Retrieves the location of where a sign should be for a plot.
      Specified by:
      getSignLoc in class PlotManager
      Parameters:
      plot - The plot
      Returns:
      The location where a sign should be
    • getPlotComponents

      public String[] getPlotComponents(@NonNull PlotId plotId)
      Description copied from class: PlotManager
      Get an array of the plot's component values as string
      Specified by:
      getPlotComponents in class PlotManager
      Parameters:
      plotId - plotId to get components of
      Returns:
      array of plot's component values
    • setComponent

      public boolean setComponent(@NonNull PlotId plotId, @NonNull String component, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Set the specified components to the specified Pattern on the specified plot.
      Specified by:
      setComponent in class PlotManager
      Parameters:
      plotId - id of plot to set component to
      component - FLOOR, WALL, AIR, MAIN, MIDDLE, OUTLINE, BORDER, ALL (floor, air and main).
      blocks - Pattern to set component to
      actor - The player executing the task
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • createRoadEast

      public boolean createRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Create the road east of the plot (not schematic-based)
      Specified by:
      createRoadEast in class PlotManager
      Parameters:
      plot - plot to create the road for
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • createRoadSouth

      public boolean createRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Create the road south of the plot (not schematic-based)
      Specified by:
      createRoadSouth in class PlotManager
      Parameters:
      plot - plot to create the road for
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • createRoadSouthEast

      public boolean createRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Create the south-east corner of the road (intersection, not schematic-based)
      Specified by:
      createRoadSouthEast in class PlotManager
      Parameters:
      plot - plot to create the road for
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • removeRoadEast

      public boolean removeRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Replace the road to the east of the plot with standard plot blocks (for when merging plots)
      Specified by:
      removeRoadEast in class PlotManager
      Parameters:
      plot - plot to remove east road from
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • removeRoadSouth

      public boolean removeRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Replace the road to the south of the plot with standard plot blocks (for when merging plots)
      Specified by:
      removeRoadSouth in class PlotManager
      Parameters:
      plot - plot to remove south road from
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • removeRoadSouthEast

      public boolean removeRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Replace the road to the south east of the plot (intersection) with standard plot blocks (for when merging plots)
      Specified by:
      removeRoadSouthEast in class PlotManager
      Parameters:
      plot - plot to remove south east road intersection from
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • startPlotMerge

      public boolean startPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Specified by:
      startPlotMerge in class PlotManager
    • startPlotUnlink

      public boolean startPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Specified by:
      startPlotUnlink in class PlotManager
    • finishPlotMerge

      public boolean finishPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).
      Specified by:
      finishPlotMerge in class PlotManager
      Parameters:
      plotIds - list of PlotIds to finish the merge for
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      false if part if the merge failed, otherwise true if successful.
    • finishPlotUnlink

      public boolean finishPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Finished off an unlink by resetting the top wall block for unlinked plots
      Specified by:
      finishPlotUnlink in class PlotManager
      Parameters:
      plotIds - list of PlotIds to reset the top wall block of
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • regenerateAllPlotWalls

      public boolean regenerateAllPlotWalls(@Nullable QueueCoordinator queue)
      Description copied from class: PlotManager
      Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).
      Overrides:
      regenerateAllPlotWalls in class PlotManager
      Parameters:
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      true if the wall blocks were successfully set