public final class ZoneHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.function.BinaryOperator<Zone> |
MIN
A binary operation which returns the smaller of two zones.
|
private static java.util.Set<Zone> |
ZONES
A set containing all zones.
|
Modifier | Constructor and Description |
---|---|
private |
ZoneHandler()
Private constructor prevents reinstantiation.
|
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addZone(Zone zone)
Adds a zone.
|
(package private) static Zone |
getSpawnZone(org.bukkit.entity.LivingEntity livingEntity)
Returns an entity's spawn zone stored in metadata.
|
static Zone |
getZone(org.bukkit.Location loc)
Returns the smallest zone containing the given location.
|
static Zone |
getZone(java.lang.String name)
Finds and returns a zone with the given name, or null if one does not exist.
|
(package private) static java.util.Set<Zone> |
getZones()
Returns all zones.
|
(package private) static java.util.LinkedHashSet<Zone> |
getZones(org.bukkit.Location location)
Finds and returns all zones which contain the given location, sorted in ascending order by radius.
|
(package private) static void |
reloadZones(java.util.Set<Zone> newZones)
Replace the current zone set with a new one.
|
(package private) static void |
removeZone(Zone zone)
Removes a zone.
|
(package private) static boolean |
zoneExists(java.lang.String name)
Returns true if the zone exists.
|
private static final java.util.Set<Zone> ZONES
private static final java.util.function.BinaryOperator<Zone> MIN
static void addZone(Zone zone)
zone
- the zone.static void removeZone(Zone zone)
zone
- the zone.public static Zone getZone(org.bukkit.Location loc)
loc
- the location.public static Zone getZone(java.lang.String name)
name
- the name to search for.static java.util.LinkedHashSet<Zone> getZones(org.bukkit.Location location)
location
- the location.static java.util.Set<Zone> getZones()
static boolean zoneExists(java.lang.String name)
name
- the name to check.static Zone getSpawnZone(org.bukkit.entity.LivingEntity livingEntity)
livingEntity
- the entity.static void reloadZones(java.util.Set<Zone> newZones)
newZones
- the new zone set.