Class Vec3i
java.lang.Object
net.minecraft.core.Vec3i
- All Implemented Interfaces:
Comparable<Vec3i>
- Direct Known Subclasses:
BlockPos, SectionPos
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Vec3i> static final StreamCodec<io.netty.buffer.ByteBuf, Vec3i> private intprivate intprivate intstatic final Vec3iAn immutable vector with zero as all coordinates. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabove()above(int steps) Offset this vector upwards by the given distance.below()below(int steps) Offset this vector downwards by the given distance.booleancloserThan(Vec3i pos, double distance) booleancloserToCenterThan(Position pos, double distance) intCalculate the cross product of this and the given VectorintdistChessboard(Vec3i pos) intdistManhattan(Vec3i pos) doubleCalculate squared distance to the given VectordoubledistToCenterSqr(double x, double y, double z) doubledistToCenterSqr(Position pos) doubledistToLowCornerSqr(double x, double y, double z) east()east(int steps) booleanintget(Direction.Axis axis) intgetX()intgetY()intgetZ()inthashCode()multiply(int scale) multiply(int xScale, int yScale, int zScale) north()north(int steps) offset(int x, int y, int z) static com.mojang.serialization.Codec<Vec3i> offsetCodec(int maxOffsetPerAxis) relative(Direction.Axis axis, int steps) 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 steps) toString()west()west(int steps)
-
Field Details
-
CODEC
-
STREAM_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
-
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
-
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
-
relative
-
cross
-
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
-
distChessboard
-
get
-
toMutable
-
toString
-
toShortString
-