Class IntXYZ
java.lang.Object
de.marcely.bedwars.tools.location.IntXYZ
- All Implemented Interfaces:
Cloneable, ConfigurationSerializable
Represents a 3-dimensional int position (i.a. block coord)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int x, int y, int z) Adds the x-coordinatesclone()static IntXYZdeserialize(Map<String, Object> data) Required method for deserializationdoubledoublebooleanequalsBlockCoords(XYZ xyz) Check whether the block coords match.booleanequalsBlockCoords(Block block) Check whether the block coords match.booleanCheck whether the block coords match.Get the Bukkit block that you can find at the given position.intgetX()Returns the x-coordinateintgetY()Returns the y-coordinateintgetZ()Returns the z-coordinatebooleanisZero()Get whether all coordinates are set to 0multiply(int amount) multiply(int x, int y, int z) set(int x, int y, int z) Sets the new coordinatesCopies and sets the xyz coordinates from the given objectCopies and sets the xyz coordinates from the given blockCopies and sets the xyz coordinates from the given objectsetX(int x) Sets the x-coordinatesetY(int y) Sets the y-coordinatesetZ(int z) Sets the z-coordinatesubtract(int x, int y, int z) toLocation(World world) Converts this XYZ object to a new Location objecttoVector()Converts this XYZ object to a new Vector objectzero()Sets all coordinates to 0
-
Field Details
-
x
protected int x -
y
protected int y -
z
protected int z
-
-
Constructor Details
-
IntXYZ
public IntXYZ() -
IntXYZ
-
IntXYZ
-
IntXYZ
-
IntXYZ
-
IntXYZ
public IntXYZ(int x, int y, int z)
-
-
Method Details
-
getX
public int getX()Returns the x-coordinate- Returns:
- The x value
-
getY
public int getY()Returns the y-coordinate- Returns:
- The y value
-
getZ
public int getZ()Returns the z-coordinate- Returns:
- The z value
-
setX
Sets the x-coordinate- Parameters:
x- The new x-coordinate- Returns:
- This IntXYZ instance
-
setY
Sets the y-coordinate- Parameters:
y- The new y-coordinate- Returns:
- This IntXYZ instance
-
setZ
Sets the z-coordinate- Parameters:
z- The new z-coordinate- Returns:
- This IntXYZ instance
-
set
Sets the new coordinates- Parameters:
x- The new x-coordinatey- The new y-coordinatez- The new z-coordinate- Returns:
- This IntXYZ instance
-
set
-
set
-
set
-
add
Adds the x-coordinates- Parameters:
x- The added x-coordinatey- The added y-coordinatez- The added z-coordinate- Returns:
- This IntXYZ instance
-
add
-
subtract
-
subtract
-
multiply
-
multiply
-
zero
-
isZero
public boolean isZero()Get whether all coordinates are set to 0- Returns:
trueif X, Y and Z are set to 0
-
distance
-
distanceSquared
-
toLocation
-
toVector
Converts this XYZ object to a new Vector object- Returns:
- A new vector whose coordinates where taken from this object
-
getBlock
-
equalsBlockCoords
Check whether the block coords match.- Parameters:
xyz- The other object to compare with- Returns:
trueif the floored coordinates match
-
equalsBlockCoords
Check whether the block coords match.- Parameters:
loc- The other object to compare with- Returns:
trueif the floored coordinates match
-
equalsBlockCoords
Check whether the block coords match.- Parameters:
block- The other object to compare with- Returns:
trueif the floored coordinates match
-
clone
-
serialize
- Specified by:
serializein interfaceConfigurationSerializable
-
deserialize
-