Package net.minecraft.util.math
Class Vec3i
java.lang.Object
net.minecraft.util.math.Vec3i
- All Implemented Interfaces:
Comparable<Vec3i>
- Direct Known Subclasses:
BlockPos,ChunkSectionPos
@Immutable public class Vec3i extends Object implements Comparable<Vec3i>
A publicly read-only but mutable vector composed of 3 integers.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description intcompareTo(Vec3i vec3i)Vec3icrossProduct(Vec3i vec)Vec3idown()Vec3idown(int distance)booleanequals(Object object)intgetComponentAlongAxis(Direction.Axis axis)intgetManhattanDistance(Vec3i vec)doublegetSquaredDistance(double x, double y, double z, boolean treatAsBlockPos)doublegetSquaredDistance(Position pos, boolean treatAsBlockPos)doublegetSquaredDistance(Vec3i vec)doublegetSquaredDistance(Vec3i vec, boolean treatAsBlockPos)intgetX()intgetY()intgetZ()inthashCode()booleanisWithinDistance(Position pos, double distance)booleanisWithinDistance(Vec3i vec, double distance)Vec3ioffset(Direction direction, int distance)protected Vec3isetX(int x)protected Vec3isetY(int y)protected Vec3isetZ(int z)StringtoShortString()StringtoString()Vec3iup()Vec3iup(int distance)
-
Field Details
-
CODEC
-
ZERO
-
x
private int x -
y
private int y -
z
private int z
-
-
Constructor Details
-
Vec3i
public Vec3i(int x, int y, int z) -
Vec3i
public Vec3i(double x, double y, double z)
-
-
Method Details
-
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
-
up
-
up
-
down
-
down
-
offset
-
crossProduct
-
isWithinDistance
-
isWithinDistance
-
getSquaredDistance
-
getSquaredDistance
-
getSquaredDistance
-
getSquaredDistance
public double getSquaredDistance(double x, double y, double z, boolean treatAsBlockPos) -
getManhattanDistance
-
getComponentAlongAxis
-
toString
-
toShortString
-