Enum Class BlockFace

java.lang.Object
java.lang.Enum<BlockFace>
com.github.retrooper.packetevents.protocol.world.BlockFace
All Implemented Interfaces:
Serializable, Comparable<BlockFace>, Constable

public enum BlockFace extends Enum<BlockFace>
The BlockFace enum contains constants for the different valid faces in the minecraft protocol.
Since:
1.7.8
See Also:
  • Enum Constant Details

    • DOWN

      public static final BlockFace DOWN
      -Y offset
    • UP

      public static final BlockFace UP
      +Y offset
    • NORTH

      public static final BlockFace NORTH
      -Z offset
    • SOUTH

      public static final BlockFace SOUTH
      +Z offset
    • WEST

      public static final BlockFace WEST
      -X offset
    • EAST

      public static final BlockFace EAST
      +X offset
    • OTHER

      public static final BlockFace OTHER
      Face is set to 255
  • Method Details

    • values

      public static BlockFace[] 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 BlockFace 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
    • getLegacyBlockFaceByValue

      public static BlockFace getLegacyBlockFaceByValue(int face)
    • getBlockFaceByValue

      public static BlockFace getBlockFaceByValue(int face)
    • getModX

      public int getModX()
    • getModY

      public int getModY()
    • getModZ

      public int getModZ()
    • getOppositeFace

      public BlockFace getOppositeFace()
    • getCCW

      public BlockFace getCCW()
    • getCW

      public BlockFace getCW()
    • getHorizontalId

      public int getHorizontalId()
      Returns an integer representing cardinal directions with south as the starting index at 0. UP and DOWN return -1

      Used by Mojang for calculations involving mob AI, decorations, paintings, item frames, maps, structure generation, campfires, stairs, connecting blocks, and flowerbeds. Also used for getting directions and block faces as rotations.

      Returns:
      integer horizontal id
    • getFaceValue

      public short getFaceValue()