java.lang.Object
com.palmergames.bukkit.towny.object.Coord
Direct Known Subclasses:
WorldCoord

public class Coord extends Object
A class to hold and calculate coordinates in a grid according to the size defined in the static field size.
Author:
Shade
  • Constructor Details

    • Coord

      public Coord(int x, int z)
    • Coord

      public Coord(Coord coord)
  • Method Details

    • getX

      public int getX()
    • getZ

      public int getZ()
    • add

      public Coord add(int xOffset, int zOffset)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toCell

      public static int toCell(int value)
      Convert a value to the grid cell counterpart
      Parameters:
      value - x/z integer
      Returns:
      cell position
    • parseCoord

      public static Coord parseCoord(int x, int z)
      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

      public static Coord parseCoord(org.bukkit.entity.Entity entity)
    • parseCoord

      public static Coord parseCoord(org.bukkit.Location loc)
    • parseCoord

      public static Coord parseCoord(org.bukkit.block.Block block)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCellSize

      public static int getCellSize()