Package com.plotsquared.core.generator
Class ClassicPlotManager
java.lang.Object
com.plotsquared.core.plot.PlotManager
com.plotsquared.core.generator.GridPlotManager
com.plotsquared.core.generator.SquarePlotManager
com.plotsquared.core.generator.ClassicPlotManager
- Direct Known Subclasses:
HybridPlotManager
A plot manager with square plots which tessellate on a square grid with the following sections: ROAD, WALL, BORDER (wall), PLOT, FLOOR (plot).
-
Constructor Summary
ConstructorsConstructorDescriptionClassicPlotManager(@NonNull ClassicPlotWorld classicPlotWorld, @NonNull RegionManager regionManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanclaimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue) booleancreateRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the road east of the plot (not schematic-based)booleancreateRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the road south of the plot (not schematic-based)booleancreateRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue) Create the south-east corner of the road (intersection, not schematic-based)booleanfinishPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).booleanfinishPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) Finished off an unlink by resetting the top wall block for unlinked plotsString[]getPlotComponents(@NonNull PlotId plotId) Get an array of the plot's component values as stringgetSignLoc(@NonNull Plot plot) Retrieves the location of where a sign should be for a plot.booleanremoveRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue) Replace the road to the east of the plot with standard plot blocks (for when merging plots)booleanremoveRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue) Replace the road to the south of the plot with standard plot blocks (for when merging plots)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)booleansetAir(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot air region.booleansetAll(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot main, floor and air areas.booleansetComponent(@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.booleansetFloor(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set the plot floorbooleansetMain(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot main blocks.booleanSet the middle plot block to a PatternbooleansetOutline(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set a plot's outlinebooleansetWall(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set a plot's wall top block onlybooleansetWallFilling(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set the wall filling for a plotbooleanstartPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) booleanstartPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue) booleanunClaimPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable QueueCoordinator queue) Completes block changes associated with plot unclaim.Methods inherited from class com.plotsquared.core.generator.SquarePlotManager
clearPlot, getNearestPlotId, getPlotBottomLocAbs, getPlotId, getPlotIdAbs, getPlotTopLocAbsMethods inherited from class com.plotsquared.core.plot.PlotManager
exportTemplate, getWorldHeight, regenerateAllPlotWalls
-
Constructor Details
-
ClassicPlotManager
@Inject public ClassicPlotManager(@NonNull ClassicPlotWorld classicPlotWorld, @NonNull RegionManager regionManager)
-
-
Method Details
-
setComponent
public boolean setComponent(@NonNull PlotId plotId, @NonNull String component, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Description copied from class:PlotManagerSet the specified components to the specified Pattern on the specified plot.- Specified by:
setComponentin classPlotManager- 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
-
unClaimPlot
public boolean unClaimPlot(@NonNull Plot plot, @Nullable Runnable whenDone, @Nullable QueueCoordinator queue) Description copied from class:PlotManagerCompletes block changes associated with plot unclaim.- Specified by:
unClaimPlotin classPlotManager- 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
-
setFloor
public boolean setFloor(@NonNull PlotId plotId, @NonNull Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set the plot floor- Parameters:
plotId- id of plot to set floor ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot main, floor and air areas.- Parameters:
plotId- id of plot to set all ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot air region.- Parameters:
plotId- id of plot to set air ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Sets the plot main blocks.- Parameters:
plotId- id of plot to set main ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable QueueCoordinator queue) Set the middle plot block to a Pattern- Parameters:
plotId- id of plot to set middle block ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set a plot's outline- Parameters:
plotId- id of plot to set outline ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue) Set the wall filling for a plot- Parameters:
plotId- id of plot to set wall filling ofblocks- pattern to setqueue- NullableQueueCoordinator. 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 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 ofblocks- pattern to setqueue- NullableQueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.- Returns:
- success or not
-
createRoadEast
Description copied from class:PlotManagerCreate the road east of the plot (not schematic-based)- Specified by:
createRoadEastin classPlotManager- 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
Description copied from class:PlotManagerCreate the road south of the plot (not schematic-based)- Specified by:
createRoadSouthin classPlotManager- 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
Description copied from class:PlotManagerCreate the south-east corner of the road (intersection, not schematic-based)- Specified by:
createRoadSouthEastin classPlotManager- 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
Description copied from class:PlotManagerReplace the road to the east of the plot with standard plot blocks (for when merging plots)- Specified by:
removeRoadEastin classPlotManager- 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
Description copied from class:PlotManagerReplace the road to the south of the plot with standard plot blocks (for when merging plots)- Specified by:
removeRoadSouthin classPlotManager- 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
Description copied from class:PlotManagerReplace the road to the south east of the plot (intersection) with standard plot blocks (for when merging plots)- Specified by:
removeRoadSouthEastin classPlotManager- 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
-
finishPlotMerge
Description copied from class:PlotManagerFinishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).- Specified by:
finishPlotMergein classPlotManager- 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:
falseif part if the merge failed, otherwisetrueif successful.
-
finishPlotUnlink
Description copied from class:PlotManagerFinished off an unlink by resetting the top wall block for unlinked plots- Specified by:
finishPlotUnlinkin classPlotManager- 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
-
startPlotMerge
- Specified by:
startPlotMergein classPlotManager
-
startPlotUnlink
- Specified by:
startPlotUnlinkin classPlotManager
-
claimPlot
- Specified by:
claimPlotin classPlotManager
-
getPlotComponents
Description copied from class:PlotManagerGet an array of the plot's component values as string- Specified by:
getPlotComponentsin classPlotManager- Parameters:
plotId- plotId to get components of- Returns:
- array of plot's component values
-
getSignLoc
Retrieves the location of where a sign should be for a plot.- Specified by:
getSignLocin classPlotManager- Parameters:
plot- The plot- Returns:
- The location where a sign should be
-