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
ConstructorDescriptionClassicPlotManager(@NonNull ClassicPlotWorld classicPlotWorld, @NonNull RegionManager regionManager)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
claimPlot(@NonNull Plot plot, @Nullable QueueCoordinator queue)
boolean
createRoadEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
Create the road east of the plot (not schematic-based)boolean
createRoadSouth(@NonNull Plot plot, @Nullable QueueCoordinator queue)
Create the road south of the plot (not schematic-based)boolean
createRoadSouthEast(@NonNull Plot plot, @Nullable QueueCoordinator queue)
Create the south-east corner of the road (intersection, not schematic-based)boolean
finishPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).boolean
finishPlotUnlink(@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.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)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)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)boolean
setAir(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
Sets the plot air region.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.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.boolean
setFloor(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
Set the plot floorboolean
setMain(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
Sets the plot main blocks.boolean
setMiddle(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable QueueCoordinator queue)
Set the middle plot block to a Patternboolean
setOutline(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
Set a plot's outlineboolean
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 onlyboolean
setWallFilling(@NonNull PlotId plotId, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
Set the wall filling for a plotboolean
startPlotMerge(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
boolean
startPlotUnlink(@NonNull List<PlotId> plotIds, @Nullable QueueCoordinator queue)
boolean
unClaimPlot(@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, getPlotTopLocAbs
Methods 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 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 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:PlotManager
Completes block changes associated with plot unclaim.- Specified by:
unClaimPlot
in 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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:PlotManager
Create the road east of the plot (not schematic-based)- Specified by:
createRoadEast
in 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:PlotManager
Create the road south of the plot (not schematic-based)- Specified by:
createRoadSouth
in 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:PlotManager
Create the south-east corner of the road (intersection, not schematic-based)- Specified by:
createRoadSouthEast
in 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:PlotManager
Replace the road to the east of the plot with standard plot blocks (for when merging plots)- Specified by:
removeRoadEast
in 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:PlotManager
Replace the road to the south of the plot with standard plot blocks (for when merging plots)- Specified by:
removeRoadSouth
in 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:PlotManager
Replace the road to the south east of the plot (intersection) with standard plot blocks (for when merging plots)- Specified by:
removeRoadSouthEast
in 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:PlotManager
Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED).- Specified by:
finishPlotMerge
in 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:
- false if part if the merge failed, otherwise true if successful.
-
finishPlotUnlink
Description copied from class:PlotManager
Finished off an unlink by resetting the top wall block for unlinked plots- Specified by:
finishPlotUnlink
in 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:
startPlotMerge
in classPlotManager
-
startPlotUnlink
- Specified by:
startPlotUnlink
in classPlotManager
-
claimPlot
- Specified by:
claimPlot
in classPlotManager
-
getPlotComponents
Description copied from class:PlotManager
Get an array of the plot's component values as string- Specified by:
getPlotComponents
in 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:
getSignLoc
in classPlotManager
- Parameters:
plot
- The plot- Returns:
- The location where a sign should be
-