Package net.minecraft.util
Enum Direction
- java.lang.Object
-
- java.lang.Enum<Direction>
-
- net.minecraft.util.Direction
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Direction>
,IStringSerializable
public enum Direction extends java.lang.Enum<Direction> implements IStringSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Direction.Axis
static class
Direction.AxisDirection
static class
Direction.Plane
-
Field Summary
Fields Modifier and Type Field Description private Direction.Axis
axis
private Direction.AxisDirection
axisDirection
private static Direction[]
BY_2D_DATA
private static Direction[]
BY_3D_DATA
private static java.util.Map<java.lang.String,Direction>
BY_NAME
private static it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction>
BY_NORMAL
private int
data2d
private int
data3d
private java.lang.String
name
private Vector3i
normal
private int
oppositeIndex
private static Direction[]
VALUES
-
Constructor Summary
Constructors Modifier Constructor Description private
Direction(int p_i46016_3_, int p_i46016_4_, int p_i46016_5_, java.lang.String p_i46016_6_, Direction.AxisDirection p_i46016_7_, Direction.Axis p_i46016_8_, Vector3i p_i46016_9_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Direction
byName(java.lang.String p_176739_0_)
static Direction
from2DDataValue(int p_176731_0_)
static Direction
from3DDataValue(int p_82600_0_)
static Direction
fromAxisAndDirection(Direction.Axis p_211699_0_, Direction.AxisDirection p_211699_1_)
static Direction
fromNormal(int p_218383_0_, int p_218383_1_, int p_218383_2_)
static Direction
fromYRot(double p_176733_0_)
static Direction
get(Direction.AxisDirection p_181076_0_, Direction.Axis p_181076_1_)
int
get2DDataValue()
int
get3DDataValue()
Direction.Axis
getAxis()
Direction.AxisDirection
getAxisDirection()
Direction
getClockWise()
Direction
getCounterClockWise()
java.lang.String
getName()
static Direction
getNearest(double p_210769_0_, double p_210769_2_, double p_210769_4_)
static Direction
getNearest(float p_176737_0_, float p_176737_1_, float p_176737_2_)
Vector3i
getNormal()
Direction
getOpposite()
static Direction
getRandom(java.util.Random p_239631_0_)
Quaternion
getRotation()
java.lang.String
getSerializedName()
int
getStepX()
int
getStepY()
int
getStepZ()
boolean
isFacingAngle(float p_243532_1_)
private static Direction[]
makeDirectionArray(Direction p_196053_0_, Direction p_196053_1_, Direction p_196053_2_)
static Direction[]
orderedByNearest(Entity p_196054_0_)
static Direction
rotate(Matrix4f p_229385_0_, Direction p_229385_1_)
Vector3f
step()
java.lang.String
toString()
float
toYRot()
static Direction
valueOf(java.lang.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.
-
-
-
Field Detail
-
data3d
private final int data3d
-
oppositeIndex
private final int oppositeIndex
-
data2d
private final int data2d
-
name
private final java.lang.String name
-
axis
private final Direction.Axis axis
-
axisDirection
private final Direction.AxisDirection axisDirection
-
normal
private final Vector3i normal
-
VALUES
private static final Direction[] VALUES
-
BY_NAME
private static final java.util.Map<java.lang.String,Direction> BY_NAME
-
BY_3D_DATA
private static final Direction[] BY_3D_DATA
-
BY_2D_DATA
private static final Direction[] BY_2D_DATA
-
BY_NORMAL
private static final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction> BY_NORMAL
-
-
Constructor Detail
-
Direction
private Direction(int p_i46016_3_, int p_i46016_4_, int p_i46016_5_, java.lang.String p_i46016_6_, Direction.AxisDirection p_i46016_7_, Direction.Axis p_i46016_8_, Vector3i p_i46016_9_)
-
-
Method Detail
-
values
public static Direction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Direction c : Direction.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Direction valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
makeDirectionArray
private static Direction[] makeDirectionArray(Direction p_196053_0_, Direction p_196053_1_, Direction p_196053_2_)
-
getRotation
public Quaternion getRotation()
-
get3DDataValue
public int get3DDataValue()
-
get2DDataValue
public int get2DDataValue()
-
getAxisDirection
public Direction.AxisDirection getAxisDirection()
-
getOpposite
public Direction getOpposite()
-
getClockWise
public Direction getClockWise()
-
getCounterClockWise
public Direction getCounterClockWise()
-
getStepX
public int getStepX()
-
getStepY
public int getStepY()
-
getStepZ
public int getStepZ()
-
step
public Vector3f step()
-
getName
public java.lang.String getName()
-
getAxis
public Direction.Axis getAxis()
-
byName
@Nullable public static Direction byName(@Nullable java.lang.String p_176739_0_)
-
from3DDataValue
public static Direction from3DDataValue(int p_82600_0_)
-
from2DDataValue
public static Direction from2DDataValue(int p_176731_0_)
-
fromNormal
@Nullable public static Direction fromNormal(int p_218383_0_, int p_218383_1_, int p_218383_2_)
-
fromYRot
public static Direction fromYRot(double p_176733_0_)
-
fromAxisAndDirection
public static Direction fromAxisAndDirection(Direction.Axis p_211699_0_, Direction.AxisDirection p_211699_1_)
-
toYRot
public float toYRot()
-
getRandom
public static Direction getRandom(java.util.Random p_239631_0_)
-
getNearest
public static Direction getNearest(double p_210769_0_, double p_210769_2_, double p_210769_4_)
-
getNearest
public static Direction getNearest(float p_176737_0_, float p_176737_1_, float p_176737_2_)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<Direction>
-
getSerializedName
public java.lang.String getSerializedName()
- Specified by:
getSerializedName
in interfaceIStringSerializable
-
get
public static Direction get(Direction.AxisDirection p_181076_0_, Direction.Axis p_181076_1_)
-
getNormal
public Vector3i getNormal()
-
isFacingAngle
public boolean isFacingAngle(float p_243532_1_)
-
-