Class Coordinate

java.lang.Object
be.seeseemelk.mockbukkit.Coordinate

public class Coordinate extends Object
A simple class that contains an x, y and z coordinate as integers.
  • Field Details

    • x

      public final int x
      The X coordinate.
    • y

      public final int y
      The Y coordinate.
    • z

      public final int z
      The Z coordinate.
  • Constructor Details

    • Coordinate

      public Coordinate(int x, int y, int z)
      Creates a new coordinate object with a specified (x, y, z).
      Parameters:
      x - The X coordinate to set.
      y - The Y coordinate to set.
      z - The Z coordinate to set.
    • Coordinate

      public Coordinate()
      Creates a coordinate object with a (x, y, z) of (0, 0, 0).
  • Method Details

    • toChunkCoordinate

      @NotNull public @NotNull ChunkCoordinate toChunkCoordinate()
      Gets the chunk coordinate this coordinate is in.
      Returns:
      The chunk coordinate of this coordinate.
    • toLocalCoordinate

      @NotNull public @NotNull Coordinate toLocalCoordinate()
      Gets the coordinate relative to the chunk.
      Returns:
      The local coordinate.
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object