public class ChunkPosition
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ChunkPosition |
ORIGIN
Represents the null (0, 0, 0) origin.
|
protected int |
x |
protected int |
y |
protected int |
z |
Constructor and Description |
---|
ChunkPosition(int x,
int y,
int z)
Construct an immutable 3D vector.
|
ChunkPosition(Vector vector)
Construct an immutable integer 3D vector from a mutable Bukkit vector.
|
Modifier and Type | Method and Description |
---|---|
ChunkPosition |
add(ChunkPosition other)
Adds the current position and a given position together, producing a result position.
|
ChunkPosition |
divide(int divisor)
Divide each dimension in the current position by the given divisor.
|
boolean |
equals(java.lang.Object obj) |
static EquivalentConverter<ChunkPosition> |
getConverter()
Used to convert between NMS ChunkPosition and the wrapper instance.
|
int |
getX()
Retrieve the x-coordinate.
|
int |
getY()
Retrieve the y-coordinate.
|
int |
getZ()
Retrieve the z-coordinate.
|
int |
hashCode() |
ChunkPosition |
multiply(int factor)
Multiply each dimension in the current position by the given factor.
|
ChunkPosition |
subtract(ChunkPosition other)
Adds the current position and a given position together, producing a result position.
|
Vector |
toVector()
Convert this instance to an equivalent real 3D vector.
|
public static ChunkPosition ORIGIN
protected final int x
protected final int y
protected final int z
public ChunkPosition(int x, int y, int z)
public ChunkPosition(Vector vector)
vector
- - the mutable real Bukkit vector to copy.public Vector toVector()
public int getX()
public int getY()
public int getZ()
public ChunkPosition add(ChunkPosition other)
other
- - the other position.public ChunkPosition subtract(ChunkPosition other)
other
- - the other position.public ChunkPosition multiply(int factor)
factor
- - multiplier.public ChunkPosition divide(int divisor)
divisor
- - the divisor.public static EquivalentConverter<ChunkPosition> getConverter()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object