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
- Mappings:
Namespace Name official gc
intermediary net/minecraft/class_2350
named net/minecraft/util/math/Direction
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Direction.Axis
static class
Direction.AxisDirection
static class
Direction.Type
Nested 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[]
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 Long2ObjectMap<Direction>
VECTOR_TO_DIRECTION
-
Constructor Summary
Constructors Modifier Constructor Description private
Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector)
-
Method Summary
Modifier and Type Method 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()
static Direction
getLookDirectionForAxis(Entity entity, Direction.Axis axis)
String
getName()
int
getOffsetX()
int
getOffsetY()
int
getOffsetZ()
Direction
getOpposite()
Quaternion
getRotationQuaternion()
Vec3f
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.
-
Enum Constant Details
-
DOWN
- Mappings:
Namespace Name Mixin selector official a
Lgc;a:Lgc;
intermediary field_11033
Lnet/minecraft/class_2350;field_11033:Lnet/minecraft/class_2350;
named DOWN
Lnet/minecraft/util/math/Direction;DOWN:Lnet/minecraft/util/math/Direction;
-
UP
- Mappings:
Namespace Name Mixin selector official b
Lgc;b:Lgc;
intermediary field_11036
Lnet/minecraft/class_2350;field_11036:Lnet/minecraft/class_2350;
named UP
Lnet/minecraft/util/math/Direction;UP:Lnet/minecraft/util/math/Direction;
-
NORTH
- Mappings:
Namespace Name Mixin selector official c
Lgc;c:Lgc;
intermediary field_11043
Lnet/minecraft/class_2350;field_11043:Lnet/minecraft/class_2350;
named NORTH
Lnet/minecraft/util/math/Direction;NORTH:Lnet/minecraft/util/math/Direction;
-
SOUTH
- Mappings:
Namespace Name Mixin selector official d
Lgc;d:Lgc;
intermediary field_11035
Lnet/minecraft/class_2350;field_11035:Lnet/minecraft/class_2350;
named SOUTH
Lnet/minecraft/util/math/Direction;SOUTH:Lnet/minecraft/util/math/Direction;
-
WEST
- Mappings:
Namespace Name Mixin selector official e
Lgc;e:Lgc;
intermediary field_11039
Lnet/minecraft/class_2350;field_11039:Lnet/minecraft/class_2350;
named WEST
Lnet/minecraft/util/math/Direction;WEST:Lnet/minecraft/util/math/Direction;
-
EAST
- Mappings:
Namespace Name Mixin selector official f
Lgc;f:Lgc;
intermediary field_11034
Lnet/minecraft/class_2350;field_11034:Lnet/minecraft/class_2350;
named EAST
Lnet/minecraft/util/math/Direction;EAST:Lnet/minecraft/util/math/Direction;
-
-
Field Details
-
ALL
- Mappings:
Namespace Name Mixin selector official n
Lgc;n:[Lgc;
intermediary field_11040
Lnet/minecraft/class_2350;field_11040:[Lnet/minecraft/class_2350;
named ALL
Lnet/minecraft/util/math/Direction;ALL:[Lnet/minecraft/util/math/Direction;
-
NAME_MAP
- Mappings:
Namespace Name Mixin selector official o
Lgc;o:Ljava/util/Map;
intermediary field_11045
Lnet/minecraft/class_2350;field_11045:Ljava/util/Map;
named NAME_MAP
Lnet/minecraft/util/math/Direction;NAME_MAP:Ljava/util/Map;
-
VALUES
- Mappings:
Namespace Name Mixin selector official p
Lgc;p:[Lgc;
intermediary field_11038
Lnet/minecraft/class_2350;field_11038:[Lnet/minecraft/class_2350;
named VALUES
Lnet/minecraft/util/math/Direction;VALUES:[Lnet/minecraft/util/math/Direction;
-
HORIZONTAL
- Mappings:
Namespace Name Mixin selector official q
Lgc;q:[Lgc;
intermediary field_11041
Lnet/minecraft/class_2350;field_11041:[Lnet/minecraft/class_2350;
named HORIZONTAL
Lnet/minecraft/util/math/Direction;HORIZONTAL:[Lnet/minecraft/util/math/Direction;
-
VECTOR_TO_DIRECTION
- Mappings:
Namespace Name Mixin selector official r
Lgc;r:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
intermediary field_16542
Lnet/minecraft/class_2350;field_16542:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
named VECTOR_TO_DIRECTION
Lnet/minecraft/util/math/Direction;VECTOR_TO_DIRECTION:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
id
private final int id- Mappings:
Namespace Name Mixin selector official g
Lgc;g:I
intermediary field_11032
Lnet/minecraft/class_2350;field_11032:I
named id
Lnet/minecraft/util/math/Direction;id:I
-
idOpposite
private final int idOpposite- Mappings:
Namespace Name Mixin selector official h
Lgc;h:I
intermediary field_11031
Lnet/minecraft/class_2350;field_11031:I
named idOpposite
Lnet/minecraft/util/math/Direction;idOpposite:I
-
idHorizontal
private final int idHorizontal- Mappings:
Namespace Name Mixin selector official i
Lgc;i:I
intermediary field_11030
Lnet/minecraft/class_2350;field_11030:I
named idHorizontal
Lnet/minecraft/util/math/Direction;idHorizontal:I
-
name
- Mappings:
Namespace Name Mixin selector official j
Lgc;j:Ljava/lang/String;
intermediary field_11046
Lnet/minecraft/class_2350;field_11046:Ljava/lang/String;
named name
Lnet/minecraft/util/math/Direction;name:Ljava/lang/String;
-
axis
- Mappings:
Namespace Name Mixin selector official k
Lgc;k:Lgc$a;
intermediary field_11047
Lnet/minecraft/class_2350;field_11047:Lnet/minecraft/class_2350$class_2351;
named axis
Lnet/minecraft/util/math/Direction;axis:Lnet/minecraft/util/math/Direction$Axis;
-
direction
- Mappings:
Namespace Name Mixin selector official l
Lgc;l:Lgc$b;
intermediary field_11044
Lnet/minecraft/class_2350;field_11044:Lnet/minecraft/class_2350$class_2352;
named direction
Lnet/minecraft/util/math/Direction;direction:Lnet/minecraft/util/math/Direction$AxisDirection;
-
vector
- Mappings:
Namespace Name Mixin selector official m
Lgc;m:Lgs;
intermediary field_11042
Lnet/minecraft/class_2350;field_11042:Lnet/minecraft/class_2382;
named vector
Lnet/minecraft/util/math/Direction;vector:Lnet/minecraft/util/math/Vec3i;
-
-
Constructor Details
-
Direction
private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector)- Mappings:
Namespace Name Mixin selector official <init>
Lgc;<init>(Ljava/lang/String;IIIILjava/lang/String;Lgc$b;Lgc$a;Lgs;)V
intermediary <init>
Lnet/minecraft/class_2350;<init>(Ljava/lang/String;IIIILjava/lang/String;Lnet/minecraft/class_2350$class_2352;Lnet/minecraft/class_2350$class_2351;Lnet/minecraft/class_2382;)V
named <init>
Lnet/minecraft/util/math/Direction;<init>(Ljava/lang/String;IIIILjava/lang/String;Lnet/minecraft/util/math/Direction$AxisDirection;Lnet/minecraft/util/math/Direction$Axis;Lnet/minecraft/util/math/Vec3i;)V
-
-
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
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Laqv;)[Lgc;
intermediary method_10159
Lnet/minecraft/class_2350;method_10159(Lnet/minecraft/class_1297;)[Lnet/minecraft/class_2350;
named getEntityFacingOrder
Lnet/minecraft/util/math/Direction;getEntityFacingOrder(Lnet/minecraft/entity/Entity;)[Lnet/minecraft/util/math/Direction;
-
listClosest
Helper function that returns the 3 directions given, followed by the 3 opposite given in opposite order.- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Lgc;Lgc;Lgc;)[Lgc;
intermediary method_10145
Lnet/minecraft/class_2350;method_10145(Lnet/minecraft/class_2350;Lnet/minecraft/class_2350;Lnet/minecraft/class_2350;)[Lnet/minecraft/class_2350;
named listClosest
Lnet/minecraft/util/math/Direction;listClosest(Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Direction;)[Lnet/minecraft/util/math/Direction;
-
transform
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Lb;Lgc;)Lgc;
intermediary method_23225
Lnet/minecraft/class_2350;method_23225(Lnet/minecraft/class_1159;Lnet/minecraft/class_2350;)Lnet/minecraft/class_2350;
named transform
Lnet/minecraft/util/math/Direction;transform(Lnet/minecraft/util/math/Matrix4f;Lnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/Direction;
-
getRotationQuaternion
- Mappings:
Namespace Name Mixin selector official b
Lgc;b()Ld;
intermediary method_23224
Lnet/minecraft/class_2350;method_23224()Lnet/minecraft/class_1158;
named getRotationQuaternion
Lnet/minecraft/util/math/Direction;getRotationQuaternion()Lnet/minecraft/util/math/Quaternion;
-
getId
public int getId()- Mappings:
Namespace Name Mixin selector official c
Lgc;c()I
intermediary method_10146
Lnet/minecraft/class_2350;method_10146()I
named getId
Lnet/minecraft/util/math/Direction;getId()I
-
getHorizontal
public int getHorizontal()- Mappings:
Namespace Name Mixin selector official d
Lgc;d()I
intermediary method_10161
Lnet/minecraft/class_2350;method_10161()I
named getHorizontal
Lnet/minecraft/util/math/Direction;getHorizontal()I
-
getDirection
- Mappings:
Namespace Name Mixin selector official e
Lgc;e()Lgc$b;
intermediary method_10171
Lnet/minecraft/class_2350;method_10171()Lnet/minecraft/class_2350$class_2352;
named getDirection
Lnet/minecraft/util/math/Direction;getDirection()Lnet/minecraft/util/math/Direction$AxisDirection;
-
getLookDirectionForAxis
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Laqv;Lgc$a;)Lgc;
intermediary method_32801
Lnet/minecraft/class_2350;method_32801(Lnet/minecraft/class_1297;Lnet/minecraft/class_2350$class_2351;)Lnet/minecraft/class_2350;
named getLookDirectionForAxis
Lnet/minecraft/util/math/Direction;getLookDirectionForAxis(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Direction$Axis;)Lnet/minecraft/util/math/Direction;
-
getOpposite
- Mappings:
Namespace Name Mixin selector official f
Lgc;f()Lgc;
intermediary method_10153
Lnet/minecraft/class_2350;method_10153()Lnet/minecraft/class_2350;
named getOpposite
Lnet/minecraft/util/math/Direction;getOpposite()Lnet/minecraft/util/math/Direction;
-
rotateYClockwise
- Mappings:
Namespace Name Mixin selector official g
Lgc;g()Lgc;
intermediary method_10170
Lnet/minecraft/class_2350;method_10170()Lnet/minecraft/class_2350;
named rotateYClockwise
Lnet/minecraft/util/math/Direction;rotateYClockwise()Lnet/minecraft/util/math/Direction;
-
rotateYCounterclockwise
- Mappings:
Namespace Name Mixin selector official h
Lgc;h()Lgc;
intermediary method_10160
Lnet/minecraft/class_2350;method_10160()Lnet/minecraft/class_2350;
named rotateYCounterclockwise
Lnet/minecraft/util/math/Direction;rotateYCounterclockwise()Lnet/minecraft/util/math/Direction;
-
getOffsetX
public int getOffsetX()- Mappings:
Namespace Name Mixin selector official i
Lgc;i()I
intermediary method_10148
Lnet/minecraft/class_2350;method_10148()I
named getOffsetX
Lnet/minecraft/util/math/Direction;getOffsetX()I
-
getOffsetY
public int getOffsetY()- Mappings:
Namespace Name Mixin selector official j
Lgc;j()I
intermediary method_10164
Lnet/minecraft/class_2350;method_10164()I
named getOffsetY
Lnet/minecraft/util/math/Direction;getOffsetY()I
-
getOffsetZ
public int getOffsetZ()- Mappings:
Namespace Name Mixin selector official k
Lgc;k()I
intermediary method_10165
Lnet/minecraft/class_2350;method_10165()I
named getOffsetZ
Lnet/minecraft/util/math/Direction;getOffsetZ()I
-
getUnitVector
- Mappings:
Namespace Name Mixin selector official l
Lgc;l()Lg;
intermediary method_23955
Lnet/minecraft/class_2350;method_23955()Lnet/minecraft/class_1160;
named getUnitVector
Lnet/minecraft/util/math/Direction;getUnitVector()Lnet/minecraft/util/math/Vec3f;
-
getName
- Mappings:
Namespace Name Mixin selector official m
Lgc;m()Ljava/lang/String;
intermediary method_10151
Lnet/minecraft/class_2350;method_10151()Ljava/lang/String;
named getName
Lnet/minecraft/util/math/Direction;getName()Ljava/lang/String;
-
getAxis
- Mappings:
Namespace Name Mixin selector official n
Lgc;n()Lgc$a;
intermediary method_10166
Lnet/minecraft/class_2350;method_10166()Lnet/minecraft/class_2350$class_2351;
named getAxis
Lnet/minecraft/util/math/Direction;getAxis()Lnet/minecraft/util/math/Direction$Axis;
-
byName
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Ljava/lang/String;)Lgc;
intermediary method_10168
Lnet/minecraft/class_2350;method_10168(Ljava/lang/String;)Lnet/minecraft/class_2350;
named byName
Lnet/minecraft/util/math/Direction;byName(Ljava/lang/String;)Lnet/minecraft/util/math/Direction;
-
byId
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(I)Lgc;
intermediary method_10143
Lnet/minecraft/class_2350;method_10143(I)Lnet/minecraft/class_2350;
named byId
Lnet/minecraft/util/math/Direction;byId(I)Lnet/minecraft/util/math/Direction;
-
fromHorizontal
- Mappings:
Namespace Name Mixin selector official b
Lgc;b(I)Lgc;
intermediary method_10139
Lnet/minecraft/class_2350;method_10139(I)Lnet/minecraft/class_2350;
named fromHorizontal
Lnet/minecraft/util/math/Direction;fromHorizontal(I)Lnet/minecraft/util/math/Direction;
-
fromVector
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(III)Lgc;
intermediary method_16365
Lnet/minecraft/class_2350;method_16365(III)Lnet/minecraft/class_2350;
named fromVector
Lnet/minecraft/util/math/Direction;fromVector(III)Lnet/minecraft/util/math/Direction;
-
fromRotation
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(D)Lgc;
intermediary method_10150
Lnet/minecraft/class_2350;method_10150(D)Lnet/minecraft/class_2350;
named fromRotation
Lnet/minecraft/util/math/Direction;fromRotation(D)Lnet/minecraft/util/math/Direction;
-
from
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Lgc$a;Lgc$b;)Lgc;
intermediary method_10169
Lnet/minecraft/class_2350;method_10169(Lnet/minecraft/class_2350$class_2351;Lnet/minecraft/class_2350$class_2352;)Lnet/minecraft/class_2350;
named from
Lnet/minecraft/util/math/Direction;from(Lnet/minecraft/util/math/Direction$Axis;Lnet/minecraft/util/math/Direction$AxisDirection;)Lnet/minecraft/util/math/Direction;
-
asRotation
public float asRotation()- Mappings:
Namespace Name Mixin selector official o
Lgc;o()F
intermediary method_10144
Lnet/minecraft/class_2350;method_10144()F
named asRotation
Lnet/minecraft/util/math/Direction;asRotation()F
-
random
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Ljava/util/Random;)Lgc;
intermediary method_10162
Lnet/minecraft/class_2350;method_10162(Ljava/util/Random;)Lnet/minecraft/class_2350;
named random
Lnet/minecraft/util/math/Direction;random(Ljava/util/Random;)Lnet/minecraft/util/math/Direction;
-
getFacing
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(DDD)Lgc;
intermediary method_10142
Lnet/minecraft/class_2350;method_10142(DDD)Lnet/minecraft/class_2350;
named getFacing
Lnet/minecraft/util/math/Direction;getFacing(DDD)Lnet/minecraft/util/math/Direction;
-
getFacing
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(FFF)Lgc;
intermediary method_10147
Lnet/minecraft/class_2350;method_10147(FFF)Lnet/minecraft/class_2350;
named getFacing
Lnet/minecraft/util/math/Direction;getFacing(FFF)Lnet/minecraft/util/math/Direction;
-
toString
-
asString
- Specified by:
asString
in interfaceStringIdentifiable
- Mappings:
Namespace Name Mixin selector official a
Lagi;a()Ljava/lang/String;
intermediary method_15434
Lnet/minecraft/class_3542;method_15434()Ljava/lang/String;
named asString
Lnet/minecraft/util/StringIdentifiable;asString()Ljava/lang/String;
-
get
- Mappings:
Namespace Name Mixin selector official a
Lgc;a(Lgc$b;Lgc$a;)Lgc;
intermediary method_10156
Lnet/minecraft/class_2350;method_10156(Lnet/minecraft/class_2350$class_2352;Lnet/minecraft/class_2350$class_2351;)Lnet/minecraft/class_2350;
named get
Lnet/minecraft/util/math/Direction;get(Lnet/minecraft/util/math/Direction$AxisDirection;Lnet/minecraft/util/math/Direction$Axis;)Lnet/minecraft/util/math/Direction;
-
getVector
- Mappings:
Namespace Name Mixin selector official p
Lgc;p()Lgs;
intermediary method_10163
Lnet/minecraft/class_2350;method_10163()Lnet/minecraft/class_2382;
named getVector
Lnet/minecraft/util/math/Direction;getVector()Lnet/minecraft/util/math/Vec3i;
-
method_30928
public boolean method_30928(float float2)- Mappings:
Namespace Name Mixin selector official a
Lgc;a(F)Z
intermediary method_30928
Lnet/minecraft/class_2350;method_30928(F)Z
named method_30928
Lnet/minecraft/util/math/Direction;method_30928(F)Z
-