2020-04-11 02:19:18 +02:00
|
|
|
package com.plotsquared.plot.worlds;
|
2017-03-17 06:40:29 +01:00
|
|
|
|
2020-04-11 02:19:18 +02:00
|
|
|
import com.plotsquared.location.Location;
|
|
|
|
import com.plotsquared.plot.PlotArea;
|
2019-11-04 22:08:33 +01:00
|
|
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
2020-02-28 22:15:04 +01:00
|
|
|
import org.jetbrains.annotations.NotNull;
|
2017-03-17 06:40:29 +01:00
|
|
|
|
|
|
|
public interface PlotAreaManager {
|
2020-02-28 22:15:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param location The location
|
|
|
|
* @return An applicable area, or null
|
|
|
|
*/
|
2019-02-13 18:05:28 +01:00
|
|
|
PlotArea getApplicablePlotArea(Location location);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2020-02-28 22:15:04 +01:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param location The location
|
|
|
|
* @return The area, if found
|
|
|
|
*/
|
|
|
|
PlotArea getPlotArea(@NotNull Location location);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
PlotArea getPlotArea(String world, String id);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-11-04 22:08:33 +01:00
|
|
|
PlotArea[] getPlotAreas(String world, CuboidRegion region);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
PlotArea[] getAllPlotAreas();
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
String[] getAllWorlds();
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
void addPlotArea(PlotArea area);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
void removePlotArea(PlotArea area);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
void addWorld(String worldName);
|
2018-08-10 17:01:10 +02:00
|
|
|
|
2019-02-13 18:05:28 +01:00
|
|
|
void removeWorld(String worldName);
|
2017-03-17 06:40:29 +01:00
|
|
|
|
|
|
|
}
|