Class PlotManager

java.lang.Object
com.plotsquared.core.plot.PlotManager
Direct Known Subclasses:
GridPlotManager, SinglePlotManager

public abstract class PlotManager extends Object
  • Constructor Details

    • PlotManager

      public PlotManager(@NonNull PlotArea plotArea)
  • Method Details

    • getPlotIdAbs

      public abstract PlotId getPlotIdAbs(int x, int y, int z)
    • getPlotId

      public abstract PlotId getPlotId(int x, int y, int z)
    • getPlotBottomLocAbs

      public abstract Location getPlotBottomLocAbs(@NonNull PlotId plotId)
    • getPlotTopLocAbs

      public abstract Location getPlotTopLocAbs(@NonNull PlotId plotId)
    • clearPlot

      public abstract boolean clearPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
    • claimPlot

      public abstract boolean claimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue)
    • unClaimPlot

      public abstract boolean unClaimPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable QueueCoordinator queue)
      Completes block changes associated with plot unclaim.
      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 abstract Location getSignLoc(@NonNull Plot plot)
      Retrieves the location of where a sign should be for a plot.
      Parameters:
      plot - The plot
      Returns:
      The location where a sign should be
    • getPlotComponents

      public abstract String[] getPlotComponents(@NonNull PlotId plotId)
      Get an array of the plot's component values as string
      Parameters:
      plotId - plotId to get components of
      Returns:
      array of plot's component values
    • setComponent

      public abstract boolean setComponent(@NonNull PlotId plotId, @NonNull String component, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set the specified components to the specified Pattern on the specified plot.
      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 abstract boolean createRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Create the road east of the plot (not schematic-based)
      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 abstract boolean createRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Create the road south of the plot (not schematic-based)
      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 abstract boolean createRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Create the south-east corner of the road (intersection, not schematic-based)
      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 abstract boolean removeRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Replace the road to the east of the plot with standard plot blocks (for when merging plots)
      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 abstract boolean removeRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Replace the road to the south of the plot with standard plot blocks (for when merging plots)
      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 abstract boolean removeRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
      Replace the road to the south east of the plot (intersection) with standard plot blocks (for when merging plots)
      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 abstract boolean startPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
    • startPlotUnlink

      public abstract boolean startPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
    • finishPlotMerge

      public abstract boolean finishPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).
      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 abstract boolean finishPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
      Finished off an unlink by resetting the top wall block for unlinked plots
      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
    • exportTemplate

      public void exportTemplate() throws IOException
      Throws:
      IOException
    • getWorldHeight

      @Deprecated(forRemoval=true) public int getWorldHeight()
      Deprecated, for removal: This API element is subject to removal in a future version.
      In favor of custom world heights within 1.17 and therefore scheduled for removal without replacement
      Returns:
      the world height
    • regenerateAllPlotWalls

      public boolean regenerateAllPlotWalls(@Nullable QueueCoordinator queue)
      Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).
      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