Package com.comphenix.protocol.wrappers
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
-
Field Summary
Fields inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
handle, handleType -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty wrapper.WrappedChunkCoordinate(int x, int y, int z)Create a wrapper with specific values.WrappedChunkCoordinate(ChunkPosition position)Create a chunk coordinate wrapper from a given position.WrappedChunkCoordinate(Comparable handle)Create a wrapper for a specific chunk coordinates. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(WrappedChunkCoordinate other)Retrieves the underlying NMS object.intgetX()Retrieve the x coordinate of the underlying coordinate.intgetY()Retrieve the y coordinate of the underlying coordinate.intgetZ()Retrieve the z coordinate of the underlying coordinate.voidsetX(int newX)Set the x coordinate of the underlying coordinate.voidsetY(int newY)Set the y coordinate of the underlying coordinate.voidsetZ(int newZ)Set the z coordinate of the underlying coordiate.Create an immutable chunk position from this coordinate.toString()Methods inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
equals, getHandleType, hashCode, setHandle
-
Constructor Details
-
WrappedChunkCoordinate
public WrappedChunkCoordinate()Create a new empty wrapper. -
WrappedChunkCoordinate
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
Create a chunk coordinate wrapper from a given position.- Parameters:
position- - the given position.
-
-
Method Details
-
getHandle
Description copied from class:AbstractWrapperRetrieves the underlying NMS object.- Overrides:
getHandlein classAbstractWrapper- 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
Create an immutable chunk position from this coordinate.- Returns:
- The new immutable chunk position.
-
compareTo
- Specified by:
compareToin interfaceComparable<WrappedChunkCoordinate>
-
toString
- Overrides:
toStringin classAbstractWrapper
-