Enum Class Direction

java.lang.Object
java.lang.Enum<Direction>
net.minecraft.core.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>, Constable, StringRepresentable

public enum Direction extends Enum<Direction> implements StringRepresentable
  • Enum Constant Details

  • Field Details

    • CODEC

      public static final StringRepresentable.EnumCodec<Direction> CODEC
    • VERTICAL_CODEC

      public static final com.mojang.serialization.Codec<Direction> VERTICAL_CODEC
    • data3d

      private final int data3d
    • oppositeIndex

      private final int oppositeIndex
    • data2d

      private final int data2d
    • name

      private final String name
    • axis

      private final Direction.Axis axis
    • axisDirection

      private final Direction.AxisDirection axisDirection
    • normal

      private final Vec3i normal
    • VALUES

      private static final Direction[] VALUES
    • 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 Details

  • Method Details

    • values

      public static Direction[] 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

      public static Direction valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • orderedByNearest

      public static Direction[] orderedByNearest(Entity p_122383_)
    • makeDirectionArray

      private static Direction[] makeDirectionArray(Direction p_122399_, Direction p_122400_, Direction p_122401_)
    • rotate

      public static Direction rotate(Matrix4f p_122385_, Direction p_122386_)
    • allShuffled

      public static Collection<Direction> allShuffled(RandomSource p_235668_)
    • stream

      public static Stream<Direction> stream()
    • getRotation

      public Quaternion getRotation()
    • get3DDataValue

      public int get3DDataValue()
    • get2DDataValue

      public int get2DDataValue()
    • getAxisDirection

      public Direction.AxisDirection getAxisDirection()
    • getFacingAxis

      public static Direction getFacingAxis(Entity p_175358_, Direction.Axis p_175359_)
    • getOpposite

      public Direction getOpposite()
    • getClockWise

      public Direction getClockWise(Direction.Axis p_175363_)
    • getCounterClockWise

      public Direction getCounterClockWise(Direction.Axis p_175365_)
    • getClockWise

      public Direction getClockWise()
    • getClockWiseX

      private Direction getClockWiseX()
    • getCounterClockWiseX

      private Direction getCounterClockWiseX()
    • getClockWiseZ

      private Direction getClockWiseZ()
    • getCounterClockWiseZ

      private Direction getCounterClockWiseZ()
    • getCounterClockWise

      public Direction getCounterClockWise()
    • getStepX

      public int getStepX()
    • getStepY

      public int getStepY()
    • getStepZ

      public int getStepZ()
    • step

      public Vector3f step()
    • getName

      public String getName()
    • getAxis

      public Direction.Axis getAxis()
    • byName

      @Nullable public static Direction byName(@Nullable String p_122403_)
    • from3DDataValue

      public static Direction from3DDataValue(int p_122377_)
    • from2DDataValue

      public static Direction from2DDataValue(int p_122408_)
    • fromNormal

      @Nullable public static Direction fromNormal(BlockPos p_175361_)
    • fromNormal

      @Nullable public static Direction fromNormal(int p_122379_, int p_122380_, int p_122381_)
    • fromYRot

      public static Direction fromYRot(double p_122365_)
    • fromAxisAndDirection

      public static Direction fromAxisAndDirection(Direction.Axis p_122388_, Direction.AxisDirection p_122389_)
    • toYRot

      public float toYRot()
    • getRandom

      public static Direction getRandom(RandomSource p_235673_)
    • getNearest

      public static Direction getNearest(double p_122367_, double p_122368_, double p_122369_)
    • getNearest

      public static Direction getNearest(float p_122373_, float p_122374_, float p_122375_)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Direction>
    • getSerializedName

      public String getSerializedName()
      Specified by:
      getSerializedName in interface StringRepresentable
    • verifyVertical

      private static com.mojang.serialization.DataResult<Direction> verifyVertical(Direction p_194529_)
    • get

      public static Direction get(Direction.AxisDirection p_122391_, Direction.Axis p_122392_)
    • getNormal

      public Vec3i getNormal()
    • isFacingAngle

      public boolean isFacingAngle(float p_122371_)