Class Coord
java.lang.Object
com.palmergames.bukkit.towny.object.Coord
- Direct Known Subclasses:
WorldCoord
A class to hold and calculate coordinates in a grid according to the size
defined in
the static field size.
- Author:
- Shade
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(int xOffset, int zOffset) boolean
static int
int
getX()
int
getZ()
int
hashCode()
static Coord
parseCoord
(int x, int z) Convert regular grid coordinates to their grid cell's counterparts.static Coord
parseCoord
(org.bukkit.block.Block block) static Coord
parseCoord
(org.bukkit.entity.Entity entity) static Coord
parseCoord
(org.bukkit.Location loc) static int
toCell
(int value) Convert a value to the grid cell counterparttoString()
-
Constructor Details
-
Coord
public Coord(int x, int z) -
Coord
-
-
Method Details
-
getX
public int getX() -
getZ
public int getZ() -
add
-
hashCode
public int hashCode() -
equals
-
toCell
public static int toCell(int value) Convert a value to the grid cell counterpart- Parameters:
value
- x/z integer- Returns:
- cell position
-
parseCoord
Convert regular grid coordinates to their grid cell's counterparts.- Parameters:
x
- - X int (Coordinates)z
- - Z int (Coordinates)- Returns:
- a new instance of Coord.
-
parseCoord
-
parseCoord
-
parseCoord
-
toString
-
getCellSize
public static int getCellSize()
-