Class DefaultPlotAreaManager

java.lang.Object
com.plotsquared.core.plot.world.DefaultPlotAreaManager
All Implemented Interfaces:
PlotAreaManager
Direct Known Subclasses:
SinglePlotAreaManager

public class DefaultPlotAreaManager extends Object implements PlotAreaManager
  • Constructor Details

    • DefaultPlotAreaManager

      public DefaultPlotAreaManager()
  • Method Details

    • getAllPlotAreas

      public @NonNull PlotArea[] getAllPlotAreas()
      Description copied from interface: PlotAreaManager
      Get all plot areas recognized by PlotSquared
      Specified by:
      getAllPlotAreas in interface PlotAreaManager
      Returns:
      All plot areas
    • getApplicablePlotArea

      public @Nullable PlotArea getApplicablePlotArea(@Nullable Location location)
      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 interface PlotAreaManager
      Parameters:
      location - The location
      Returns:
      An applicable area, or null
    • addPlotArea

      public void addPlotArea(@NonNull PlotArea plotArea)
      Description copied from interface: PlotAreaManager
      Add a plot area
      Specified by:
      addPlotArea in interface PlotAreaManager
      Parameters:
      plotArea - Area
    • removePlotArea

      public void removePlotArea(@NonNull PlotArea area)
      Description copied from interface: PlotAreaManager
      Remove a plot area
      Specified by:
      removePlotArea in interface PlotAreaManager
      Parameters:
      area - Area
    • getPlotArea

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

      public @Nullable PlotArea getPlotArea(@NonNull Location location)
      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 interface PlotAreaManager
      Parameters:
      location - The location
      Returns:
      The area if found, else null
    • getPlotAreas

      public @NonNull PlotArea[] getPlotAreas(@NonNull String world, @Nullable com.sk89q.worldedit.regions.CuboidRegion region)
      Description copied from interface: PlotAreaManager
      Get all plot areas in a world, with an optional region constraint
      Specified by:
      getPlotAreas in interface PlotAreaManager
      Parameters:
      world - World name
      region - Optional region
      Returns:
      All plots in the region
    • addWorld

      public void addWorld(@NonNull String worldName)
      Description copied from interface: PlotAreaManager
      Add a world
      Specified by:
      addWorld in interface PlotAreaManager
      Parameters:
      worldName - Name of the world to add
    • removeWorld

      public void removeWorld(@NonNull String worldName)
      Description copied from interface: PlotAreaManager
      Remove a world
      Specified by:
      removeWorld in interface PlotAreaManager
      Parameters:
      worldName - Name of the world to remove
    • getAllWorlds

      public @NonNull String[] getAllWorlds()
      Description copied from interface: PlotAreaManager
      Get all worlds recognized by PlotSquared
      Specified by:
      getAllWorlds in interface PlotAreaManager
      Returns:
      All world names