Package com.plotsquared.core.plot
Class PlotManager
java.lang.Object
com.plotsquared.core.plot.PlotManager
- Direct Known Subclasses:
GridPlotManager,SinglePlotManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanclaimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue)abstract booleanclearPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)abstract booleancreateRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)Create the road east of the plot (not schematic-based)abstract booleancreateRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)Create the road south of the plot (not schematic-based)abstract booleancreateRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)Create the south-east corner of the road (intersection, not schematic-based)voidabstract booleanfinishPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).abstract booleanfinishPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)Finished off an unlink by resetting the top wall block for unlinked plotsabstract LocationgetPlotBottomLocAbs(@NonNull PlotId plotId)abstract String[]getPlotComponents(@NonNull PlotId plotId)Get an array of the plot's component values as stringabstract PlotIdgetPlotId(int x, int y, int z)abstract PlotIdgetPlotIdAbs(int x, int y, int z)abstract LocationgetPlotTopLocAbs(@NonNull PlotId plotId)abstract LocationgetSignLoc(@NonNull Plot plot)Retrieves the location of where a sign should be for a plot.intDeprecated, 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 replacementbooleanregenerateAllPlotWalls(@Nullable QueueCoordinator queue)Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).abstract booleanremoveRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)Replace the road to the east of the plot with standard plot blocks (for when merging plots)abstract booleanremoveRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)Replace the road to the south of the plot with standard plot blocks (for when merging plots)abstract booleanremoveRoadSouthEast(@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)abstract booleansetComponent(@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.abstract booleanstartPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)abstract booleanstartPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)abstract booleanunClaimPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable QueueCoordinator queue)Completes block changes associated with plot unclaim.
-
Constructor Details
-
PlotManager
-
-
Method Details
-
getPlotIdAbs
-
getPlotId
-
getPlotBottomLocAbs
-
getPlotTopLocAbs
-
clearPlot
public abstract boolean clearPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) -
claimPlot
-
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 unclaimwhenDone- task to run when plot is unclaimedqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
getSignLoc
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
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 tocomponent- FLOOR, WALL, AIR, MAIN, MIDDLE, OUTLINE, BORDER, ALL (floor, air and main).blocks- Pattern to set component toactor- The player executing the taskqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
createRoadEast
Create the road east of the plot (not schematic-based)- Parameters:
plot- plot to create the road forqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
createRoadSouth
Create the road south of the plot (not schematic-based)- Parameters:
plot- plot to create the road forqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
createRoadSouthEast
Create the south-east corner of the road (intersection, not schematic-based)- Parameters:
plot- plot to create the road forqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
removeRoadEast
Replace the road to the east of the plot with standard plot blocks (for when merging plots)- Parameters:
plot- plot to remove east road fromqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
removeRoadSouth
Replace the road to the south of the plot with standard plot blocks (for when merging plots)- Parameters:
plot- plot to remove south road fromqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
removeRoadSouthEast
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 fromqueue- NullableQueueCoordinator. 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 forqueue- NullableQueueCoordinator. 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 ofqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
exportTemplate
- Throws:
IOException
-
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
Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).- Parameters:
queue- NullableQueueCoordinator. 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
-