public class WauzRegion
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<WauzRegion> |
children
All regions inside this region.
|
private java.awt.geom.Ellipse2D |
ellipse
The ellipse, that represents the region.
|
private static java.lang.String |
FLAG_BUILD
The flag to allow building in a region.
|
private static java.lang.String |
FLAG_PROTECTED
The flag to prevent changes in a region.
|
private static java.lang.String |
FLAG_PVP
The flag to enable pvp in a region.
|
private java.util.List<java.lang.String> |
flags
The flags of this region.
|
private static java.util.List<WauzRegion> |
masterRegions
A list of all top level regions.
|
private java.lang.String |
music
The music that plays to players inside the region.
|
private WauzRegion |
parent
The region, this region is inside.
|
private java.awt.Polygon |
polygon
The polygon, that represents the region.
|
private static int |
regionCount
The number of all constructed regions.
|
private java.lang.String |
regionKey
The configuration key of this region.
|
private java.lang.String |
subtitle
The subtitle that is shown when entering the region.
|
private byte |
temperature
The base temperature of the region.
|
private java.lang.String |
title
The title that is shown when entering the region.
|
private java.lang.String |
type
The type of this region a text.
|
private java.lang.String |
world
The name of the world, that represents the region.
|
Constructor and Description |
---|
WauzRegion(WauzRegion parent,
java.lang.String regionKey)
Constructs a region, based on the region file in the /WauzCore folder.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
disallowBlockChange(org.bukkit.block.Block block) |
static boolean |
disallowBuild(org.bukkit.block.Block block) |
static boolean |
disallowPvP(org.bukkit.entity.Entity attacker,
org.bukkit.entity.Entity attacked) |
void |
enter(org.bukkit.entity.Player player)
Called when a player enters the region.
|
java.util.List<WauzRegion> |
getChildren() |
java.awt.geom.Ellipse2D |
getEllipse() |
java.util.List<java.lang.String> |
getFlags() |
static WauzRegion |
getNewRegion(org.bukkit.Location location)
Finds out the region of a location, if the current region is unknown.
|
private static WauzRegion |
getNewRegion(org.bukkit.Location location,
WauzRegion region,
boolean knownToBeInRegion)
Finds out the region of a location, if the current region is known.
|
WauzRegion |
getParent() |
java.awt.Polygon |
getPolygon() |
java.lang.String |
getRegionKey() |
java.lang.String |
getSubtitle() |
byte |
getTemperature() |
java.lang.String |
getTitle() |
java.lang.String |
getType() |
java.lang.String |
getWorld() |
static void |
init()
Initializes all master regions and their sub regions.
|
private static boolean |
insideEllipseRegion(org.bukkit.Location location,
java.awt.geom.Ellipse2D ellipse) |
private static boolean |
insidePolygonRegion(org.bukkit.Location location,
java.awt.Polygon polygon) |
private static boolean |
insideRegion(org.bukkit.Location location,
WauzRegion region) |
private static boolean |
insideWorldRegion(org.bukkit.Location location,
java.lang.String world) |
static boolean |
isCombatZone(org.bukkit.Location location) |
static void |
regionCheck(org.bukkit.entity.Player player)
Checks if a player region is still valid and determines the new region, if not.
|
java.lang.String |
toString() |
private static java.util.List<WauzRegion> masterRegions
private static int regionCount
private static final java.lang.String FLAG_BUILD
private static final java.lang.String FLAG_PROTECTED
private static final java.lang.String FLAG_PVP
private WauzRegion parent
private java.util.List<WauzRegion> children
private java.lang.String regionKey
private java.lang.String type
private java.lang.String world
private java.awt.Polygon polygon
private java.awt.geom.Ellipse2D ellipse
private java.lang.String title
private java.lang.String subtitle
private java.lang.String music
private byte temperature
private java.util.List<java.lang.String> flags
public WauzRegion(WauzRegion parent, java.lang.String regionKey)
parent
- The region, this region is inside.regionKey
- The configuration key of this region.public static void init()
public static void regionCheck(org.bukkit.entity.Player player)
player
- The player whose region should be updated.getNewRegion(Location)
,
getNewRegion(Location, WauzRegion, boolean)
,
enter(Player)
,
WauzNoteBlockPlayer.play(Player)
public static boolean disallowBuild(org.bukkit.block.Block block)
block
- The affected block.public static boolean disallowBlockChange(org.bukkit.block.Block block)
block
- The affected block.public static boolean disallowPvP(org.bukkit.entity.Entity attacker, org.bukkit.entity.Entity attacked)
attacker
- The entity that is attacking.attacked
- The entity that gets attacked.public static boolean isCombatZone(org.bukkit.Location location)
location
- The affected location.public static WauzRegion getNewRegion(org.bukkit.Location location)
location
- The location to check.private static WauzRegion getNewRegion(org.bukkit.Location location, WauzRegion region, boolean knownToBeInRegion)
location
- The location to check.region
- The current region.knownToBeInRegion
- If it should not be checked if the current region is still valid.private static boolean insideRegion(org.bukkit.Location location, WauzRegion region)
location
- The location to check.region
- The region to check.private static boolean insideWorldRegion(org.bukkit.Location location, java.lang.String world)
location
- The location to check.world
- The name of the world, that represents the region.private static boolean insidePolygonRegion(org.bukkit.Location location, java.awt.Polygon polygon)
location
- The location to check.polygon
- The polygon, that represents the region.private static boolean insideEllipseRegion(org.bukkit.Location location, java.awt.geom.Ellipse2D ellipse)
location
- The location to check.ellipse
- The ellipse, that represents the region.public void enter(org.bukkit.entity.Player player)
player
- The player that entered the region.public WauzRegion getParent()
public java.util.List<WauzRegion> getChildren()
public java.lang.String getRegionKey()
public java.lang.String getType()
public java.lang.String getWorld()
public java.awt.Polygon getPolygon()
public java.awt.geom.Ellipse2D getEllipse()
public java.lang.String getTitle()
public java.lang.String getSubtitle()
public byte getTemperature()
public java.util.List<java.lang.String> getFlags()
public java.lang.String toString()
toString
in class java.lang.Object