Enum Class Direction
- All Implemented Interfaces:
Serializable, Comparable<Direction>, Constable, StringRepresentable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Nested classes/interfaces inherited from interface StringRepresentable
StringRepresentable.EnumCodec<E>, StringRepresentable.StringRepresentableCodec<S> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Direction.Axisprivate final Direction.AxisDirectionprivate static final Direction[]private static final Direction[]static final IntFunction<Direction> static final StringRepresentable.EnumCodec<Direction> private final intprivate final intstatic final com.mojang.serialization.Codec<Direction> Deprecated.static final com.mojang.serialization.Codec<Direction> Deprecated.private final Stringprivate final Vec3iprivate final Vec3private final Vector3fcprivate final intstatic final StreamCodec<io.netty.buffer.ByteBuf, Direction> private static final Direction[]static final com.mojang.serialization.Codec<Direction> private static final ImmutableList<Direction.Axis> private static final ImmutableList<Direction.Axis> Fields inherited from interface StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDirection(int data3d, int oppositeIndex, int data2d, String name, Direction.AxisDirection axisDirection, Direction.Axis axis, Vec3i normal) -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Direction> allShuffled(RandomSource random) static ImmutableList<Direction.Axis> axisStepOrder(Vec3 movement) static Directionfrom2DDataValue(int data) static Directionfrom3DDataValue(int data) static DirectionfromAxisAndDirection(Direction.Axis axis, Direction.AxisDirection direction) static DirectionfromYRot(double yRot) static Directionget(Direction.AxisDirection axisDirection, Direction.Axis axis) intintstatic DirectiongetApproximateNearest(double dx, double dy, double dz) static DirectiongetApproximateNearest(float dx, float dy, float dz) static DirectiongetAxis()getClockWise(Direction.Axis axis) private Directionprivate Directionprivate Directionprivate Directionstatic DirectiongetFacingAxis(Entity entity, Direction.Axis axis) getName()getNearest(int x, int y, int z, @Nullable Direction orElse) getNearest(Vec3i vec, @Nullable Direction orElse) static DirectiongetRandom(RandomSource random) intgetStepX()intgetStepY()intgetStepZ()static floatbooleanisFacingAngle(float yAngle) private static Direction[]makeDirectionArray(Direction axis1, Direction axis2, Direction axis3) static Direction[]orderedByNearest(Entity entity) static Directionstep()stream()toString()floattoYRot()static DirectionReturns 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.private static com.mojang.serialization.DataResult<Direction>
-
Enum Constant Details
-
DOWN
-
UP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
-
Field Details
-
CODEC
-
VERTICAL_CODEC
-
BY_ID
-
STREAM_CODEC
-
LEGACY_ID_CODEC
Deprecated. -
LEGACY_ID_CODEC_2D
Deprecated. -
YXZ_AXIS_ORDER
-
YZX_AXIS_ORDER
-
data3d
private final int data3d -
oppositeIndex
private final int oppositeIndex -
data2d
private final int data2d -
name
-
axis
-
axisDirection
-
normal
-
normalVec3
-
normalVec3f
-
VALUES
-
BY_3D_DATA
-
BY_2D_DATA
-
-
Constructor Details
-
Direction
private Direction(int data3d, int oppositeIndex, int data2d, String name, Direction.AxisDirection axisDirection, Direction.Axis axis, Vec3i normal)
-
-
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
-
allShuffled
-
stream
-
getYRot
-
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
-
fromYRot
-
fromAxisAndDirection
public static Direction fromAxisAndDirection(Direction.Axis axis, Direction.AxisDirection direction) -
toYRot
public float toYRot() -
getRandom
-
getApproximateNearest
-
getApproximateNearest
-
getApproximateNearest
-
getNearest
-
getNearest
-
toString
-
getSerializedName
- Specified by:
getSerializedNamein interfaceStringRepresentable
-
verifyVertical
-
get
-
axisStepOrder
-
getUnitVec3i
-
getUnitVec3
-
getUnitVec3f
-
isFacingAngle
public boolean isFacingAngle(float yAngle)
-