Class Vector3i
java.lang.Object
com.github.retrooper.packetevents.util.Vector3i
3D int Vector.
This vector can represent coordinates, angles, or anything you want.
You can use this to represent an array if you really want.
PacketEvents usually uses this for block positions as they don't need any decimals.
- Since:
- 1.7
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVector3i()
Default constructor setting all coordinates/angles/values to their default values (=0).Vector3i
(int[] array) Constructor allowing you to specify an array.Vector3i
(int x, int y, int z) Constructor allowing you to set the values.Vector3i
(long val) Vector3i
(long val, ServerVersion serverVersion) -
Method Summary
Modifier and TypeMethodDescriptionadd
(int x, int y, int z) crossProduct
(Vector3i other) int
boolean
Is the object we are comparing to equal to us? It must be of type Vector3d or Vector3i and all values must be equal to the values in this class.long
long
getSerializedPosition
(ServerVersion serverVersion) int
getX()
int
getY()
int
getZ()
int
hashCode()
multiply
(int value) multiply
(int x, int y, int z) subtract
(int x, int y, int z) toString()
withX
(int x) withY
(int y) withZ
(int z) static Vector3i
zero()
-
Field Details
-
x
public final int xX (coordinate/angle/whatever you wish) -
y
public final int yY (coordinate/angle/whatever you wish) -
z
public final int zZ (coordinate/angle/whatever you wish)
-
-
Constructor Details
-
Vector3i
public Vector3i()Default constructor setting all coordinates/angles/values to their default values (=0). -
Vector3i
public Vector3i(long val) -
Vector3i
-
Vector3i
public Vector3i(int x, int y, int z) Constructor allowing you to set the values.- Parameters:
x
- Xy
- Yz
- Z
-
Vector3i
public Vector3i(int[] array) Constructor allowing you to specify an array. X will be set to the first index of an array(if it exists, otherwise 0). Y will be set to the second index of an array(if it exists, otherwise 0). Z will be set to the third index of an array(if it exists, otherwise 0).- Parameters:
array
- Array.
-
-
Method Details
-
getSerializedPosition
-
getSerializedPosition
public long getSerializedPosition() -
getX
public int getX() -
getY
public int getY() -
getZ
public int getZ() -
equals
Is the object we are comparing to equal to us? It must be of type Vector3d or Vector3i and all values must be equal to the values in this class. -
hashCode
public int hashCode() -
toVector3d
-
add
-
add
-
offset
-
subtract
-
subtract
-
multiply
-
multiply
-
multiply
-
crossProduct
-
dot
-
with
-
withX
-
withY
-
withZ
-
toString
-
zero
-