Interface PlotAreaManager

All Known Implementing Classes:
DefaultPlotAreaManager, SinglePlotAreaManager

public interface PlotAreaManager
  • Method Details

    • getApplicablePlotArea

      @Nullable PlotArea getApplicablePlotArea(@Nullable Location location)
      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

      @Nullable PlotArea getPlotArea(@NonNull Location location)
      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

      @Nullable PlotArea getPlotArea(@NonNull String world, @Nullable String id)
      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 name
      id - Area ID
      Returns:
      Plot area matching the criteria
    • getPlotAreas

      @NonNull PlotArea[] getPlotAreas(@NonNull String world, @Nullable CuboidRegion region)
      Get all plot areas in a world, with an optional region constraint
      Parameters:
      world - World name
      region - Optional region
      Returns:
      All plots in the region
    • getAllPlotAreas

      @NonNull PlotArea[] getAllPlotAreas()
      Get all plot areas recognized by PlotSquared
      Returns:
      All plot areas
    • getAllWorlds

      @NonNull String[] getAllWorlds()
      Get all worlds recognized by PlotSquared
      Returns:
      All world names
    • addPlotArea

      void addPlotArea(@NonNull PlotArea area)
      Add a plot area
      Parameters:
      area - Area
    • removePlotArea

      void removePlotArea(@NonNull PlotArea area)
      Remove a plot area
      Parameters:
      area - Area
    • addWorld

      void addWorld(@NonNull String worldName)
      Add a world
      Parameters:
      worldName - Name of the world to add
    • removeWorld

      void removeWorld(@NonNull String worldName)
      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 to getPlotAreas(String, CuboidRegion) but returns an immutable set, instead of an array
      Parameters:
      world - World name
      region - Optional region
      Returns:
      All areas in the world (and region)
    • getPlotAreasSet

      default @NonNull Set<@NonNull PlotArea> getPlotAreasSet(@NonNull String world)
      Method identical to getPlotAreasSet(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

      default @Nullable PlotArea 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 optional
      Parameters:
      search - Search string
      Returns:
      An area that matches the search string, or null
    • hasPlotArea

      default boolean hasPlotArea(@NonNull String world)
      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

      default boolean isAugmented(@NonNull String world)
      Check if a given world is an augmented plot world
      Parameters:
      world - World name
      Returns:
      true if the world is augmented plot world, false if not
    • forEachPlotArea

      default void forEachPlotArea(@NonNull Consumer<? super PlotArea> action)
      Perform an action on each recognized plot area
      Parameters:
      action - Action to perform