Package com.plotsquared.core.plot.world
Class DefaultPlotAreaManager
java.lang.Object
com.plotsquared.core.plot.world.DefaultPlotAreaManager
- All Implemented Interfaces:
PlotAreaManager
- Direct Known Subclasses:
SinglePlotAreaManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlotArea
(@NonNull PlotArea plotArea) Add a plot areaboolean
Add a worldGet all plot areas recognized by PlotSquaredGet all worlds recognized by PlotSquaredgetApplicablePlotArea
(@Nullable Location location) Get the plot area for a particular location.getPlotArea
(@NonNull Location location) Get the plot area, if there is any, for the given location.getPlotArea
(@NonNull String world, @Nullable String id) Get the plot area in a world with an (optional ID).getPlotAreas
(@NonNull String world, @Nullable CuboidRegion region) Get all plot areas in a world, with an optional region constraintvoid
removePlotArea
(@NonNull PlotArea area) Remove a plot areavoid
removeWorld
(@NonNull String worldName) Remove a worldMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.plotsquared.core.plot.world.PlotAreaManager
forEachPlotArea, getPlotAreaByString, getPlotAreasSet, getPlotAreasSet, hasPlotArea, isAugmented
-
Constructor Details
-
DefaultPlotAreaManager
public DefaultPlotAreaManager()
-
-
Method Details
-
getAllPlotAreas
Description copied from interface:PlotAreaManager
Get all plot areas recognized by PlotSquared- Specified by:
getAllPlotAreas
in interfacePlotAreaManager
- Returns:
- All plot areas
-
getApplicablePlotArea
Description copied from interface:PlotAreaManager
Get the plot area for a particular location. This method assumes that the caller already knows that the location belongs to a plot area, in which case it will return the appropriate plot area.If the location does not belong to a plot area, it may still return an area.
- Specified by:
getApplicablePlotArea
in interfacePlotAreaManager
- Parameters:
location
- The location- Returns:
- An applicable area, or null
-
addPlotArea
Description copied from interface:PlotAreaManager
Add a plot area- Specified by:
addPlotArea
in interfacePlotAreaManager
- Parameters:
plotArea
- Area
-
removePlotArea
Description copied from interface:PlotAreaManager
Remove a plot area- Specified by:
removePlotArea
in interfacePlotAreaManager
- Parameters:
area
- Area
-
getPlotArea
Description copied from interface:PlotAreaManager
Get the plot area in a world with an (optional ID). If the world has more than one plot area, and ID must be supplied. If the world only has one plot area, the ID will be ignored- Specified by:
getPlotArea
in interfacePlotAreaManager
- Parameters:
world
- World nameid
- Area ID- Returns:
- Plot area matching the criteria
-
getPlotArea
Description copied from interface:PlotAreaManager
Get the plot area, if there is any, for the given location. This may return null, if given location does not belong to a plot area.- Specified by:
getPlotArea
in interfacePlotAreaManager
- Parameters:
location
- The location- Returns:
- The area if found, else
null
-
getPlotAreas
Description copied from interface:PlotAreaManager
Get all plot areas in a world, with an optional region constraint- Specified by:
getPlotAreas
in interfacePlotAreaManager
- Parameters:
world
- World nameregion
- Optional region- Returns:
- All plots in the region
-
addWorld
Description copied from interface:PlotAreaManager
Add a world- Specified by:
addWorld
in interfacePlotAreaManager
- Parameters:
worldName
- Name of the world to add- Returns:
true
if successful,false
if world already existed
-
removeWorld
Description copied from interface:PlotAreaManager
Remove a world- Specified by:
removeWorld
in interfacePlotAreaManager
- Parameters:
worldName
- Name of the world to remove
-
getAllWorlds
Description copied from interface:PlotAreaManager
Get all worlds recognized by PlotSquared- Specified by:
getAllWorlds
in interfacePlotAreaManager
- Returns:
- All world names
-