Package net.minecraft.core
Enum Class Direction
- All Implemented Interfaces:
Serializable
,Comparable<Direction>
,Constable
,StringRepresentable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate Direction.Axis
private Direction.AxisDirection
private static Direction[]
private static Direction[]
private static it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction>
static com.mojang.serialization.Codec<Direction>
private int
private int
private String
private Vec3i
private int
private static Direction[]
-
Constructor Summary
ModifierConstructorDescriptionprivate
Direction(int p_122356_, int p_122357_, int p_122358_, String p_122359_, Direction.AxisDirection p_122360_, Direction.Axis p_122361_, Vec3i p_122362_)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Direction
static Direction
from2DDataValue(int p_122408_)
static Direction
from3DDataValue(int p_122377_)
static Direction
fromAxisAndDirection(Direction.Axis p_122388_, Direction.AxisDirection p_122389_)
static Direction
fromNormal(int p_122379_, int p_122380_, int p_122381_)
static Direction
fromNormal(BlockPos p_175361_)
static Direction
fromYRot(double p_122365_)
static Direction
get(Direction.AxisDirection p_122391_, Direction.Axis p_122392_)
int
int
getAxis()
getClockWise(Direction.Axis p_175363_)
private Direction
private Direction
getCounterClockWise(Direction.Axis p_175365_)
private Direction
private Direction
static Direction
getFacingAxis(Entity p_175358_, Direction.Axis p_175359_)
getName()
static Direction
getNearest(double p_122367_, double p_122368_, double p_122369_)
static Direction
getNearest(float p_122373_, float p_122374_, float p_122375_)
static Direction
int
getStepX()
int
getStepY()
int
getStepZ()
boolean
isFacingAngle(float p_122371_)
private static Direction[]
makeDirectionArray(Direction p_122399_, Direction p_122400_, Direction p_122401_)
static Direction[]
orderedByNearest(Entity p_122383_)
static Direction
step()
toString()
float
toYRot()
static Direction
Returns the enum constant of this class with the specified name.static Direction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DOWN
-
UP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
-
Field Details
-
CODEC
-
data3d
private final int data3d -
oppositeIndex
private final int oppositeIndex -
data2d
private final int data2d -
name
-
axis
-
axisDirection
-
normal
-
VALUES
-
BY_NAME
-
BY_3D_DATA
-
BY_2D_DATA
-
BY_NORMAL
-
-
Constructor Details
-
Direction
private Direction(int p_122356_, int p_122357_, int p_122358_, String p_122359_, Direction.AxisDirection p_122360_, Direction.Axis p_122361_, Vec3i p_122362_)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
orderedByNearest
-
makeDirectionArray
-
rotate
-
getRotation
-
get3DDataValue
public int get3DDataValue() -
get2DDataValue
public int get2DDataValue() -
getAxisDirection
-
getFacingAxis
-
getOpposite
-
getClockWise
-
getCounterClockWise
-
getClockWise
-
getClockWiseX
-
getCounterClockWiseX
-
getClockWiseZ
-
getCounterClockWiseZ
-
getCounterClockWise
-
getStepX
public int getStepX() -
getStepY
public int getStepY() -
getStepZ
public int getStepZ() -
step
-
getName
-
getAxis
-
byName
-
from3DDataValue
-
from2DDataValue
-
fromNormal
-
fromNormal
-
fromYRot
-
fromAxisAndDirection
public static Direction fromAxisAndDirection(Direction.Axis p_122388_, Direction.AxisDirection p_122389_) -
toYRot
public float toYRot() -
getRandom
-
getNearest
-
getNearest
-
toString
-
getSerializedName
- Specified by:
getSerializedName
in interfaceStringRepresentable
-
get
-
getNormal
-
isFacingAngle
public boolean isFacingAngle(float p_122371_)
-