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.booleancloserThan(Vec3i vector, double distance) booleancloserToCenterThan(Position position, double distance) intCalculate the cross product of this and the given VectorintdistManhattan(Vec3i vector) doubleCalculate squared distance to the given VectordoubledistToCenterSqr(double x, double y, double z) doubledistToCenterSqr(Position position) doubledistToLowCornerSqr(double x, double y, double z) east()east(int distance) booleanintget(Direction.Axis axis) intgetX()intgetY()intgetZ()inthashCode()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 Vec3isetX(int x) protected Vec3isetY(int y) protected Vec3isetZ(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:
compareToin 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
-