Class WrappedChunkCoordinate

java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedChunkCoordinate
All Implemented Interfaces:
Comparable<WrappedChunkCoordinate>

public class WrappedChunkCoordinate extends AbstractWrapper implements Comparable<WrappedChunkCoordinate>
Allows access to a chunk coordinate.
Author:
Kristian
  • Constructor Details

    • WrappedChunkCoordinate

      public WrappedChunkCoordinate()
      Create a new empty wrapper.
    • WrappedChunkCoordinate

      public WrappedChunkCoordinate(Comparable handle)
      Create a wrapper for a specific chunk coordinates.
      Parameters:
      handle - - the NMS chunk coordinates.
    • WrappedChunkCoordinate

      public WrappedChunkCoordinate(int x, int y, int z)
      Create a wrapper with specific values.
      Parameters:
      x - - the x coordinate.
      y - - the y coordinate.
      z - - the z coordinate.
    • WrappedChunkCoordinate

      public WrappedChunkCoordinate(ChunkPosition position)
      Create a chunk coordinate wrapper from a given position.
      Parameters:
      position - - the given position.
  • Method Details

    • getHandle

      public Object getHandle()
      Description copied from class: AbstractWrapper
      Retrieves the underlying NMS object.
      Overrides:
      getHandle in class AbstractWrapper
      Returns:
      The underlying NMS object.
    • getX

      public int getX()
      Retrieve the x coordinate of the underlying coordinate.
      Returns:
      The x coordinate.
    • setX

      public void setX(int newX)
      Set the x coordinate of the underlying coordinate.
      Parameters:
      newX - - the new x coordinate.
    • getY

      public int getY()
      Retrieve the y coordinate of the underlying coordinate.
      Returns:
      The y coordinate.
    • setY

      public void setY(int newY)
      Set the y coordinate of the underlying coordinate.
      Parameters:
      newY - - the new y coordinate.
    • getZ

      public int getZ()
      Retrieve the z coordinate of the underlying coordinate.
      Returns:
      The z coordinate.
    • setZ

      public void setZ(int newZ)
      Set the z coordinate of the underlying coordiate.
      Parameters:
      newZ - - the new z coordinate.
    • toPosition

      public ChunkPosition toPosition()
      Create an immutable chunk position from this coordinate.
      Returns:
      The new immutable chunk position.
    • compareTo

      public int compareTo(WrappedChunkCoordinate other)
      Specified by:
      compareTo in interface Comparable<WrappedChunkCoordinate>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractWrapper