Package net.minecraft.util.math
Enum Direction
- All Implemented Interfaces:
Serializable,Comparable<Direction>,java.lang.constant.Constable,StringIdentifiable
public enum Direction extends Enum<Direction> implements StringIdentifiable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDirection.Axisstatic classDirection.AxisDirectionstatic classDirection.TypeNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description private static Direction[]ALLprivate Direction.Axisaxisprivate Direction.AxisDirectiondirectionprivate static Direction[]HORIZONTALprivate intidprivate intidHorizontalprivate intidOppositeprivate Stringnameprivate static Map<String,Direction>NAME_MAPprivate static Direction[]VALUESprivate Vec3ivectorprivate static Long2ObjectMap<Direction>VECTOR_TO_DIRECTION -
Constructor Summary
Constructors Modifier Constructor Description privateDirection(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) -
Method Summary
Modifier and Type Method Description floatasRotation()StringasString()static DirectionbyId(int id)static DirectionbyName(String name)static Directionfrom(Direction.Axis axis, Direction.AxisDirection direction)static DirectionfromHorizontal(int value)static DirectionfromRotation(double rotation)static DirectionfromVector(int x, int y, int z)static Directionget(Direction.AxisDirection direction, Direction.Axis axis)Direction.AxisgetAxis()Direction.AxisDirectiongetDirection()static Direction[]getEntityFacingOrder(Entity entity)static DirectiongetFacing(double x, double y, double z)static DirectiongetFacing(float x, float y, float z)intgetHorizontal()intgetId()static DirectiongetLookDirectionForAxis(Entity entity, Direction.Axis axis)StringgetName()intgetOffsetX()intgetOffsetY()intgetOffsetZ()DirectiongetOpposite()QuaterniongetRotationQuaternion()Vec3fgetUnitVector()Vec3igetVector()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.booleanmethod_30928(float float2)static Directionrandom(Random random)DirectionrotateYClockwise()DirectionrotateYCounterclockwise()StringtoString()static Directiontransform(Matrix4f matrix, Direction direction)static DirectionvalueOf(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.
-
Enum Constant Details
-
DOWN
-
UP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
-
Field Details
-
ALL
-
NAME_MAP
-
VALUES
-
HORIZONTAL
-
VECTOR_TO_DIRECTION
-
id
private final int id -
idOpposite
private final int idOpposite -
idHorizontal
private final int idHorizontal -
name
-
axis
-
direction
-
vector
-
-
Constructor Details
-
Direction
private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getEntityFacingOrder
-
listClosest
Helper function that returns the 3 directions given, followed by the 3 opposite given in opposite order. -
transform
-
getRotationQuaternion
-
getId
public int getId() -
getHorizontal
public int getHorizontal() -
getDirection
-
getLookDirectionForAxis
-
getOpposite
-
rotateYClockwise
-
rotateYCounterclockwise
-
getOffsetX
public int getOffsetX() -
getOffsetY
public int getOffsetY() -
getOffsetZ
public int getOffsetZ() -
getUnitVector
-
getName
-
getAxis
-
byName
-
byId
-
fromHorizontal
-
fromVector
-
fromRotation
-
from
-
asRotation
public float asRotation() -
random
-
getFacing
-
getFacing
-
toString
-
asString
- Specified by:
asStringin interfaceStringIdentifiable
-
get
-
getVector
-
method_30928
public boolean method_30928(float float2)
-