@Immutable public class Vec3i extends Object implements Comparable<Vec3i>
Modifier and Type | Field and Description |
---|---|
static com.mojang.serialization.Codec<Vec3i> |
CODEC |
private int |
x |
private int |
y |
private int |
z |
static Vec3i |
ZERO |
Constructor and Description |
---|
Vec3i(double x,
double y,
double z) |
Vec3i(int x,
int y,
int z) |
Modifier and Type | Method and 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) |
public static final com.mojang.serialization.Codec<Vec3i> CODEC
public static final Vec3i ZERO
private int x
private int y
private int z
public Vec3i(int x, int y, int z)
public Vec3i(double x, double y, double z)
public int compareTo(Vec3i vec3i)
compareTo
in interface Comparable<Vec3i>
public int getX()
public int getY()
public int getZ()
protected void setX(int x)
protected void setY(int y)
protected void setZ(int z)
public Vec3i up()
public Vec3i up(int distance)
public Vec3i down()
public Vec3i down(int distance)
public boolean isWithinDistance(Vec3i vec, double distance)
public boolean isWithinDistance(Position pos, double distance)
public double getSquaredDistance(Vec3i vec)
public double getSquaredDistance(Position pos, boolean treatAsBlockPos)
public double getSquaredDistance(double x, double y, double z, boolean treatAsBlockPos)
public int getManhattanDistance(Vec3i vec)
public int getComponentAlongAxis(Direction.Axis axis)
@Environment(value=CLIENT) public String toShortString()