Enum Class BlockFace

java.lang.Object
java.lang.Enum<BlockFace>
fr.fidorial.world.BlockFace
All Implemented Interfaces:
Serializable, Comparable<BlockFace>, Constable

public enum BlockFace extends Enum<BlockFace>
One of the six sides of a block, in protocol order.
Since:
0.1.0
  • Enum Constant Details

    • DOWN

      public static final BlockFace DOWN
      Towards negative Y.
    • UP

      public static final BlockFace UP
      Towards positive Y.
    • NORTH

      public static final BlockFace NORTH
      Towards negative Z.
    • SOUTH

      public static final BlockFace SOUTH
      Towards positive Z.
    • WEST

      public static final BlockFace WEST
      Towards negative X.
    • EAST

      public static final BlockFace EAST
      Towards positive X.
  • 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
    • byId

      public static BlockFace byId(int id)
      Returns the face with the given protocol identifier, or UP when it is out of range.
      Parameters:
      id - the protocol identifier, 0 to 5
      Returns:
      the face with the given protocol identifier, or UP when it is out of range
      Since:
      0.1.0
    • opposite

      public BlockFace opposite()
      Returns the face pointing the other way.
      Returns:
      the face pointing the other way
      Since:
      0.1.0
    • dx

      public int dx()
      Returns the step this face makes on the X axis, -1, 0 or 1.
      Returns:
      the step this face makes on the X axis, -1, 0 or 1
      Since:
      0.1.0
    • dy

      public int dy()
      Returns the step this face makes on the Y axis, -1, 0 or 1.
      Returns:
      the step this face makes on the Y axis, -1, 0 or 1
      Since:
      0.1.0
    • dz

      public int dz()
      Returns the step this face makes on the Z axis, -1, 0 or 1.
      Returns:
      the step this face makes on the Z axis, -1, 0 or 1
      Since:
      0.1.0