Package com.plotsquared.core.plot.world
Interface PlotAreaManager
- All Known Implementing Classes:
DefaultPlotAreaManager,SinglePlotAreaManager
public interface PlotAreaManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlotArea(@NonNull PlotArea area) Add a plot areavoidAdd a worlddefault voidforEachPlotArea(@NonNull Consumer<? super PlotArea> action) Perform an action on each recognized plot areaGet 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).getPlotAreaByString(@NonNull String search) Get a plot area from a search string in the format "world;id" or "world,id" where the ID portion is optionalgetPlotAreas(@NonNull String world, @Nullable CuboidRegion region) Get all plot areas in a world, with an optional region constraintgetPlotAreasSet(@NonNull String world) Method identical togetPlotAreasSet(String, CuboidRegion)but that does not take in a region, and returns a modifiable setgetPlotAreasSet(@NonNull String world, @Nullable CuboidRegion region) Method that delegates togetPlotAreas(String, CuboidRegion)but returns an immutable set, instead of an arraydefault booleanhasPlotArea(@NonNull String world) Check if a plot world.default booleanisAugmented(@NonNull String world) Check if a given world is an augmented plot worldvoidremovePlotArea(@NonNull PlotArea area) Remove a plot areavoidremoveWorld(@NonNull String worldName) Remove a world
-
Method Details
-
getApplicablePlotArea
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.
- Parameters:
location- The location- Returns:
- An applicable area, or null
-
getPlotArea
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.- Parameters:
location- The location- Returns:
- The area if found, else
null
-
getPlotArea
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- Parameters:
world- World nameid- Area ID- Returns:
- Plot area matching the criteria
-
getPlotAreas
Get all plot areas in a world, with an optional region constraint- Parameters:
world- World nameregion- Optional region- Returns:
- All plots in the region
-
getAllPlotAreas
Get all plot areas recognized by PlotSquared- Returns:
- All plot areas
-
getAllWorlds
Get all worlds recognized by PlotSquared- Returns:
- All world names
-
addPlotArea
Add a plot area- Parameters:
area- Area
-
removePlotArea
Remove a plot area- Parameters:
area- Area
-
addWorld
Add a world- Parameters:
worldName- Name of the world to add
-
removeWorld
Remove a world- Parameters:
worldName- Name of the world to remove
-
getPlotAreasSet
default @NonNull Set<@NonNull PlotArea> getPlotAreasSet(@NonNull String world, @Nullable CuboidRegion region) Method that delegates togetPlotAreas(String, CuboidRegion)but returns an immutable set, instead of an array- Parameters:
world- World nameregion- Optional region- Returns:
- All areas in the world (and region)
-
getPlotAreasSet
Method identical togetPlotAreasSet(String, CuboidRegion)but that does not take in a region, and returns a modifiable set- Parameters:
world- World name- Returns:
- Modifiable set containing all plot areas in the specified world
-
getPlotAreaByString
Get a plot area from a search string in the format "world;id" or "world,id" where the ID portion is optional- Parameters:
search- Search string- Returns:
- An area that matches the search string, or
null
-
hasPlotArea
Check if a plot world.Use
getPlotAreaByString(String)to get the PlotArea object- Parameters:
world- the world- Returns:
- if a plot world is registered
-
isAugmented
Check if a given world is an augmented plot world- Parameters:
world- World name- Returns:
trueif the world is augmented plot world,falseif not
-
forEachPlotArea
Perform an action on each recognized plot area- Parameters:
action- Action to perform
-