Enum Class BlockFace

java.lang.Object
java.lang.Enum<BlockFace>
wtf.choco.veinminer.util.BlockFace
All Implemented Interfaces:
Serializable, Comparable<BlockFace>, Constable

public enum BlockFace extends Enum<BlockFace>
Represents a block face.
  • Enum Constant Details

    • NORTH

      public static final BlockFace NORTH
      North (z -1).
    • EAST

      public static final BlockFace EAST
      East (x +1).
    • SOUTH

      public static final BlockFace SOUTH
      South (z +1).
    • WEST

      public static final BlockFace WEST
      West (x -1).
    • UP

      public static final BlockFace UP
      Up (y +1).
    • DOWN

      public static final BlockFace DOWN
      Down (y -1).
    • NORTH_EAST

      public static final BlockFace NORTH_EAST
      North east (x +1, z -1).
    • NORTH_WEST

      public static final BlockFace NORTH_WEST
      North west (x -1, z -1).
    • SOUTH_EAST

      public static final BlockFace SOUTH_EAST
      South east (x +1, z +1).
    • SOUTH_WEST

      public static final BlockFace SOUTH_WEST
      South west (x -1, z +1).
    • NORTH_UP

      public static final BlockFace NORTH_UP
      North up (y +1, z -1).
    • EAST_UP

      public static final BlockFace EAST_UP
      East up (x +1, y +1).
    • SOUTH_UP

      public static final BlockFace SOUTH_UP
      South up (y +1, z +1).
    • WEST_UP

      public static final BlockFace WEST_UP
      West up (x -1, y +1).
    • NORTH_DOWN

      public static final BlockFace NORTH_DOWN
      North down (y -1, z -1).
    • EAST_DOWN

      public static final BlockFace EAST_DOWN
      East down (x +1, y -1).
    • SOUTH_DOWN

      public static final BlockFace SOUTH_DOWN
      South down (y -1, z +1).
    • WEST_DOWN

      public static final BlockFace WEST_DOWN
      West down (x -1, y -1).
  • 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
    • getXOffset

      public int getXOffset()
      Get the x offset of this block face.
      Returns:
      the x offset
    • getYOffset

      public int getYOffset()
      Get the y offset of this block face.
      Returns:
      the y offset
    • getZOffset

      public int getZOffset()
      Get the z offset of this block face.
      Returns:
      the z offset
    • getOpposite

      @NotNull public @NotNull BlockFace getOpposite()
      Get the BlockFace opposite to this BlockFace. Note that this works only for cardinal faces (up, down, east, west, north, and south). Any other face will throw an UnsupportedOperationException.
      Returns:
      the opposite block face
    • getRelative

      @NotNull public @NotNull BlockPosition getRelative(@NotNull @NotNull BlockPosition position)
      Get a BlockPosition offset by this BlockFace's offset coordinates relative to the given BlockPosition.
      Parameters:
      position - the block of reference
      Returns:
      the relative block