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
    • BY_ID

      public static final IntFunction<Direction> BY_ID
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf,Direction> STREAM_CODEC
    • LEGACY_ID_CODEC

      @Deprecated public static final com.mojang.serialization.Codec<Direction> LEGACY_ID_CODEC
      Deprecated.
    • LEGACY_ID_CODEC_2D

      @Deprecated public static final com.mojang.serialization.Codec<Direction> LEGACY_ID_CODEC_2D
      Deprecated.
    • 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
    • normalVec3

      private final Vec3 normalVec3
    • normalVec3f

      private final org.joml.Vector3fc normalVec3f
    • 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
  • 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(org.joml.Matrix4fc p_405508_, Direction p_254252_)
    • allShuffled

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

      public static Stream<Direction> stream()
    • getYRot

      public static float getYRot(Direction p_363445_)
    • getRotation

      public org.joml.Quaternionf 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 org.joml.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_)
    • 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_)
    • getApproximateNearest

      public static Direction getApproximateNearest(double p_362121_, double p_364871_, double p_364153_)
    • getApproximateNearest

      public static Direction getApproximateNearest(float p_122373_, float p_122374_, float p_122375_)
    • getApproximateNearest

      public static Direction getApproximateNearest(Vec3 p_361200_)
    • getNearest

      @Nullable @Contract("_,_,_,!null->!null;_,_,_,_->_") public static Direction getNearest(int p_365087_, int p_364094_, int p_361757_, @Nullable Direction p_364698_)
    • getNearest

      @Nullable @Contract("_,!null->!null;_,_->_") public static Direction getNearest(Vec3i p_362245_, @Nullable Direction p_363910_)
    • 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_)
    • getUnitVec3i

      public Vec3i getUnitVec3i()
    • getUnitVec3

      public Vec3 getUnitVec3()
    • getUnitVec3f

      public org.joml.Vector3fc getUnitVec3f()
    • isFacingAngle

      public boolean isFacingAngle(float p_122371_)