Package net.minecraft.core
Class Vec3i
java.lang.Object
net.minecraft.core.Vec3i
- All Implemented Interfaces:
Comparable<Vec3i>
- Direct Known Subclasses:
BlockPos
,SectionPos
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabove()
above
(int pDistance) Offset this vector upwards by the given distance.below()
below
(int pDistance) Offset this vector downwards by the given distance.boolean
closerThan
(Vec3i pVector, double pDistance) boolean
closerToCenterThan
(Position pPosition, double pDistance) int
Calculate the cross product of this and the given Vectorint
distManhattan
(Vec3i pVector) double
Calculate squared distance to the given Vectordouble
distToCenterSqr
(double pX, double pY, double pZ) double
distToCenterSqr
(Position pPosition) double
distToLowCornerSqr
(double pX, double pY, double pZ) east()
east
(int pDistance) boolean
int
get
(Direction.Axis pAxis) int
getX()
int
getY()
int
getZ()
int
hashCode()
multiply
(int pScalar) north()
north
(int pDistance) offset
(int pDx, int pDy, int pDz) static com.mojang.serialization.Codec
<Vec3i> offsetCodec
(int p_194651_) relative
(Direction.Axis pAxis, int pAmount) Offsets this Vector by the given distance in the specified direction.protected Vec3i
setX
(int pX) protected Vec3i
setY
(int pY) protected Vec3i
setZ
(int pZ) south()
south
(int pDistance) toString()
west()
west
(int pDistance)
-
Field Details
-
CODEC
-
ZERO
An immutable vector with zero as all coordinates. -
x
private int x -
y
private int y -
z
private int z
-
-
Constructor Details
-
Vec3i
public Vec3i(int pX, int pY, int pZ)
-
-
Method Details
-
offsetCodec
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Vec3i>
-
getX
public int getX() -
getY
public int getY() -
getZ
public int getZ() -
setX
-
setY
-
setZ
-
offset
-
offset
-
subtract
-
multiply
-
above
-
above
Offset this vector upwards by the given distance. -
below
-
below
Offset this vector downwards by the given distance. -
north
-
north
-
south
-
south
-
west
-
west
-
east
-
east
-
relative
-
relative
Offsets this Vector by the given distance in the specified direction. -
relative
-
cross
Calculate the cross product of this and the given Vector -
closerThan
-
closerToCenterThan
-
distSqr
Calculate squared distance to the given Vector -
distToCenterSqr
-
distToCenterSqr
public double distToCenterSqr(double pX, double pY, double pZ) -
distToLowCornerSqr
public double distToLowCornerSqr(double pX, double pY, double pZ) -
distManhattan
-
get
-
toString
-
toShortString
-