public class BlockPosition extends Object
| Modifier and Type | Field and Description |
|---|---|
static BlockPosition |
ORIGIN
Represents the null (0, 0, 0) origin.
|
protected int |
x |
protected int |
y |
protected int |
z |
| Constructor and Description |
|---|
BlockPosition(int x,
int y,
int z)
Construct an immutable 3D vector.
|
BlockPosition(org.bukkit.util.Vector vector)
Construct an immutable integer 3D vector from a mutable Bukkit vector.
|
| Modifier and Type | Method and Description |
|---|---|
BlockPosition |
add(BlockPosition other)
Adds the current position and a given position together, producing a result position.
|
BlockPosition |
divide(int divisor)
Divide each dimension in the current position by the given divisor.
|
boolean |
equals(Object obj) |
static EquivalentConverter<BlockPosition> |
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() |
BlockPosition |
multiply(int factor)
Multiply each dimension in the current position by the given factor.
|
BlockPosition |
subtract(BlockPosition other)
Adds the current position and a given position together, producing a result position.
|
org.bukkit.Location |
toLocation(org.bukkit.World world)
Convert this instance to an equivalent Location.
|
String |
toString() |
org.bukkit.util.Vector |
toVector()
Convert this instance to an equivalent real 3D vector.
|
public static BlockPosition ORIGIN
protected final int x
protected final int y
protected final int z
public BlockPosition(int x,
int y,
int z)
x - - x coordinatey - - y coordinatez - - z coordinatepublic BlockPosition(org.bukkit.util.Vector vector)
vector - - the mutable real Bukkit vector to copy.public org.bukkit.util.Vector toVector()
public org.bukkit.Location toLocation(org.bukkit.World world)
world - World for the locationpublic int getX()
public int getY()
public int getZ()
public BlockPosition add(BlockPosition other)
other - - the other position.public BlockPosition subtract(BlockPosition other)
other - - the other position.public BlockPosition multiply(int factor)
factor - - multiplier.public BlockPosition divide(int divisor)
divisor - - the divisor.public static EquivalentConverter<BlockPosition> getConverter()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.