public enum Direction extends Enum<Direction> implements StringIdentifiable
Modifier and Type | Class and Description |
---|---|
static class |
Direction.Axis |
static class |
Direction.AxisDirection |
static class |
Direction.Type |
Modifier and Type | Field and Description |
---|---|
private static Direction[] |
ALL |
private Direction.Axis |
axis |
private Direction.AxisDirection |
direction |
private static Direction[] |
HORIZONTAL |
private int |
id |
private int |
idHorizontal |
private int |
idOpposite |
private String |
name |
private static Map<String,Direction> |
NAME_MAP |
private static Direction[] |
VALUES |
private Vec3i |
vector |
private static it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction> |
VECTOR_TO_DIRECTION |
Modifier and Type | Method and Description |
---|---|
float |
asRotation() |
String |
asString() |
static Direction |
byId(int id) |
static Direction |
byName(String name) |
static Direction |
from(Direction.Axis axis,
Direction.AxisDirection direction) |
static Direction |
fromHorizontal(int value) |
static Direction |
fromRotation(double rotation) |
static Direction |
fromVector(int x,
int y,
int z) |
static Direction |
get(Direction.AxisDirection direction,
Direction.Axis axis) |
Direction.Axis |
getAxis() |
Direction.AxisDirection |
getDirection() |
static Direction[] |
getEntityFacingOrder(Entity entity) |
static Direction |
getFacing(double x,
double y,
double z) |
static Direction |
getFacing(float x,
float y,
float z) |
int |
getHorizontal() |
int |
getId() |
String |
getName() |
int |
getOffsetX() |
int |
getOffsetY() |
int |
getOffsetZ() |
Direction |
getOpposite() |
Quaternion |
getRotationQuaternion() |
Vector3f |
getUnitVector() |
Vec3i |
getVector() |
private static Direction[] |
listClosest(Direction first,
Direction second,
Direction third)
Helper function that returns the 3 directions given, followed by the 3 opposite given in opposite order.
|
boolean |
method_30928(float float2) |
static Direction |
random(Random random) |
Direction |
rotateYClockwise() |
Direction |
rotateYCounterclockwise() |
String |
toString() |
static Direction |
transform(Matrix4f matrix,
Direction direction) |
static Direction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
createCodec, createCodec, method_28142
public static final Direction DOWN
public static final Direction UP
public static final Direction NORTH
public static final Direction SOUTH
public static final Direction WEST
public static final Direction EAST
private static final Direction[] ALL
private static final Direction[] VALUES
private static final Direction[] HORIZONTAL
private static final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction> VECTOR_TO_DIRECTION
private final int id
private final int idOpposite
private final int idHorizontal
private final String name
private final Direction.Axis axis
private final Direction.AxisDirection direction
private final Vec3i vector
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprivate static Direction[] listClosest(Direction first, Direction second, Direction third)
@Environment(value=CLIENT) public static Direction transform(Matrix4f matrix, Direction direction)
@Environment(value=CLIENT) public Quaternion getRotationQuaternion()
public int getId()
public int getHorizontal()
public Direction.AxisDirection getDirection()
public Direction getOpposite()
public Direction rotateYClockwise()
public Direction rotateYCounterclockwise()
public int getOffsetX()
public int getOffsetY()
public int getOffsetZ()
@Environment(value=CLIENT) public Vector3f getUnitVector()
public String getName()
public Direction.Axis getAxis()
public static Direction byId(int id)
public static Direction fromHorizontal(int value)
public static Direction fromRotation(double rotation)
public static Direction from(Direction.Axis axis, Direction.AxisDirection direction)
public float asRotation()
public static Direction getFacing(double x, double y, double z)
public static Direction getFacing(float x, float y, float z)
public String asString()
asString
in interface StringIdentifiable
public static Direction get(Direction.AxisDirection direction, Direction.Axis axis)
public Vec3i getVector()
public boolean method_30928(float float2)