Enum Direction

java.lang.Object
java.lang.Enum<Direction>
net.minecraft.util.math.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>, java.lang.constant.Constable, StringIdentifiable

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

  • Field Details

    • ALL

      private static final Direction[] ALL
    • NAME_MAP

      private static final Map<String,​Direction> NAME_MAP
    • VALUES

      private static final Direction[] VALUES
    • HORIZONTAL

      private static final Direction[] HORIZONTAL
    • VECTOR_TO_DIRECTION

      private static final Long2ObjectMap<Direction> VECTOR_TO_DIRECTION
    • id

      private final int id
    • idOpposite

      private final int idOpposite
    • idHorizontal

      private final int idHorizontal
    • name

      private final String name
    • axis

      private final Direction.Axis axis
    • direction

      private final Direction.AxisDirection direction
    • vector

      private final Vec3i vector
  • Constructor Details

  • Method Details

    • values

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

      public static Direction valueOf​(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getEntityFacingOrder

      public static Direction[] getEntityFacingOrder​(Entity entity)
    • listClosest

      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.
    • transform

      @Environment(CLIENT) public static Direction transform​(Matrix4f matrix, Direction direction)
    • getRotationQuaternion

      @Environment(CLIENT) public Quaternion getRotationQuaternion()
    • getId

      public int getId()
    • getHorizontal

      public int getHorizontal()
    • getDirection

      public Direction.AxisDirection getDirection()
    • getOpposite

      public Direction getOpposite()
    • rotateYClockwise

      public Direction rotateYClockwise()
    • rotateYCounterclockwise

      public Direction rotateYCounterclockwise()
    • getOffsetX

      public int getOffsetX()
    • getOffsetY

      public int getOffsetY()
    • getOffsetZ

      public int getOffsetZ()
    • getUnitVector

      @Environment(CLIENT) public Vector3f getUnitVector()
    • getName

      public String getName()
    • getAxis

      public Direction.Axis getAxis()
    • byName

      @Environment(CLIENT) @Nullable public static Direction byName​(@Nullable String name)
    • byId

      public static Direction byId​(int id)
    • fromHorizontal

      public static Direction fromHorizontal​(int value)
    • fromVector

      @Nullable public static Direction fromVector​(int x, int y, int z)
    • fromRotation

      public static Direction fromRotation​(double rotation)
    • from

      public static Direction from​(Direction.Axis axis, Direction.AxisDirection direction)
    • asRotation

      public float asRotation()
    • random

      public static Direction random​(Random random)
    • getFacing

      public static Direction getFacing​(double x, double y, double z)
    • getFacing

      public static Direction getFacing​(float x, float y, float z)
    • toString

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

      public String asString()
      Specified by:
      asString in interface StringIdentifiable
    • get

      public static Direction get​(Direction.AxisDirection direction, Direction.Axis axis)
    • getVector

      public Vec3i getVector()
    • method_30928

      public boolean method_30928​(float float2)