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 distance) Offset this vector upwards by the given distance.below()
below
(int distance) Offset this vector downwards by the given distance.boolean
closerThan
(Vec3i vector, double distance) boolean
closerToCenterThan
(Position position, double distance) int
Calculate the cross product of this and the given Vectorint
distManhattan
(Vec3i vector) double
Calculate squared distance to the given Vectordouble
distToCenterSqr
(double x, double y, double z) double
distToCenterSqr
(Position position) double
distToLowCornerSqr
(double x, double y, double z) east()
east
(int distance) boolean
int
get
(Direction.Axis axis) int
getX()
int
getY()
int
getZ()
int
hashCode()
multiply
(int scalar) north()
north
(int distance) offset
(int dx, int dy, int dz) static com.mojang.serialization.Codec
<Vec3i> offsetCodec
(int maxOffset) relative
(Direction.Axis axis, int amount) Offsets this Vector by the given distance in the specified direction.protected Vec3i
setX
(int x) protected Vec3i
setY
(int y) protected Vec3i
setZ
(int z) south()
south
(int distance) toString()
west()
west
(int distance)
-
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 x, int y, int z)
-
-
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 x, double y, double z) -
distToLowCornerSqr
public double distToLowCornerSqr(double x, double y, double z) -
distManhattan
-
get
-
toString
-
toShortString
-