Package com.plotsquared.core.plot
Class PlotManager
java.lang.Object
com.plotsquared.core.plot.PlotManager
- Direct Known Subclasses:
GridPlotManager
,SinglePlotManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
claimPlot
(@NonNull Plot plot, @Nullable QueueCoordinator queue) abstract boolean
clearPlot
(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) abstract boolean
createRoadEast
(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the road east of the plot (not schematic-based)abstract boolean
createRoadSouth
(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the road south of the plot (not schematic-based)abstract boolean
createRoadSouthEast
(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the south-east corner of the road (intersection, not schematic-based)void
abstract boolean
finishPlotMerge
(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).abstract boolean
finishPlotUnlink
(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) Finished off an unlink by resetting the top wall block for unlinked plotsabstract Location
getPlotBottomLocAbs
(@NonNull PlotId plotId) abstract String[]
getPlotComponents
(@NonNull PlotId plotId) Get an array of the plot's component values as stringabstract PlotId
getPlotId
(int x, int y, int z) abstract PlotId
getPlotIdAbs
(int x, int y, int z) abstract Location
getPlotTopLocAbs
(@NonNull PlotId plotId) abstract Location
getSignLoc
(@NonNull Plot plot) Retrieves the location of where a sign should be for a plot.int
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 replacementboolean
Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).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)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)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)abstract boolean
setComponent
(@NonNull PlotId plotId, @NonNull String component, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set the specified components to the specified Pattern on the specified plot.abstract boolean
startPlotMerge
(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) abstract boolean
startPlotUnlink
(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) abstract boolean
unClaimPlot
(@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 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, otherwisetrue
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
-