Class ClassicPlotManager

Direct Known Subclasses:
HybridPlotManager

public class ClassicPlotManager extends SquarePlotManager
A plot manager with square plots which tessellate on a square grid with the following sections: ROAD, WALL, BORDER (wall), PLOT, FLOOR (plot).
  • Constructor Details

  • Method Details

    • 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
    • unClaimPlot

      public boolean unClaimPlot(@NonNull Plot plot, @Nullable 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
    • setFloor

      public boolean setFloor(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set the plot floor
      Parameters:
      plotId - id of plot to set floor of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setAll

      public boolean setAll(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Sets the plot main, floor and air areas.
      Parameters:
      plotId - id of plot to set all of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setAir

      public boolean setAir(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Sets the plot air region.
      Parameters:
      plotId - id of plot to set air of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setMain

      public boolean setMain(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Sets the plot main blocks.
      Parameters:
      plotId - id of plot to set main of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setMiddle

      public boolean setMiddle(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable QueueCoordinator queue)
      Set the middle plot block to a Pattern
      Parameters:
      plotId - id of plot to set middle block of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setOutline

      public boolean setOutline(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set a plot's outline
      Parameters:
      plotId - id of plot to set outline of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setWallFilling

      public boolean setWallFilling(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set the wall filling for a plot
      Parameters:
      plotId - id of plot to set wall filling of
      blocks - pattern to set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      success or not
    • setWall

      public boolean setWall(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set a plot's wall top block only
      Parameters:
      plotId - id of plot to set wall top block of
      blocks - pattern to set
      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
    • 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
    • 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
    • claimPlot

      public boolean claimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Specified by:
      claimPlot in class PlotManager
    • 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
    • getSignLoc

      public Location getSignLoc(@NonNull Plot plot)
      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