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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int xOffset, int zOffset) booleanstatic intintgetX()intgetZ()inthashCode()static CoordparseCoord(int x, int z) Convert regular grid coordinates to their grid cell's counterparts.static CoordparseCoord(org.bukkit.block.Block block) static CoordparseCoord(org.bukkit.entity.Entity entity) static CoordparseCoord(org.bukkit.Location loc) static inttoCell(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()
-