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
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 pDistance) Offset this vector upwards by the given distance.below()below(int pDistance) Offset this vector downwards by the given distance.booleancloserThan(Vec3i pVector, double pDistance) booleancloserToCenterThan(Position pPosition, double pDistance) intCalculate the cross product of this and the given VectorintdistChessboard(Vec3i pVector) intdistManhattan(Vec3i pVector) doubleCalculate squared distance to the given VectordoubledistToCenterSqr(double pX, double pY, double pZ) doubledistToCenterSqr(Position pPosition) doubledistToLowCornerSqr(double pX, double pY, double pZ) east()east(int pDistance) booleanintget(Direction.Axis pAxis) intgetX()intgetY()intgetZ()inthashCode()multiply(int pScalar) north()north(int pDistance) offset(int pDx, int pDy, int pDz) static com.mojang.serialization.Codec<Vec3i> offsetCodec(int pMaxOffset) relative(Direction.Axis pAxis, int pAmount) Offsets this Vector by the given distance in the specified direction.protected Vec3isetX(int pX) protected Vec3isetY(int pY) protected Vec3isetZ(int pZ) south()south(int pDistance) toString()west()west(int pDistance)
-
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 pX, int pY, int pZ)
-
-
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 pX, double pY, double pZ) -
distToLowCornerSqr
public double distToLowCornerSqr(double pX, double pY, double pZ) -
distManhattan
-
distChessboard
-
get
-
toString
-
toShortString
-