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>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
compareTo(Vec3i vec3i)
Vec3i
crossProduct(Vec3i vec)
Vec3i
down()
Vec3i
down(int distance)
boolean
equals(Object object)
int
getComponentAlongAxis(Direction.Axis axis)
int
getManhattanDistance(Vec3i vec)
double
getSquaredDistance(double x, double y, double z, boolean treatAsBlockPos)
double
getSquaredDistance(Position pos, boolean treatAsBlockPos)
double
getSquaredDistance(Vec3i vec)
int
getX()
int
getY()
int
getZ()
int
hashCode()
boolean
isWithinDistance(Position pos, double distance)
boolean
isWithinDistance(Vec3i vec, double distance)
Vec3i
offset(Direction direction, int distance)
protected void
setX(int x)
protected void
setY(int y)
protected void
setZ(int z)
String
toShortString()
String
toString()
Vec3i
up()
Vec3i
up(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:
compareTo
in interfaceComparable<Vec3i>
-
getX
public int getX() -
getY
public int getY() -
getZ
public int getZ() -
setX
protected void setX(int x) -
setY
protected void setY(int y) -
setZ
protected void setZ(int z) -
up
-
up
-
down
-
down
-
offset
-
crossProduct
-
isWithinDistance
-
isWithinDistance
-
getSquaredDistance
-
getSquaredDistance
-
getSquaredDistance
public double getSquaredDistance(double x, double y, double z, boolean treatAsBlockPos) -
getManhattanDistance
-
getComponentAlongAxis
-
toString
-
toShortString
-