程序包 cn.nukkit.math

Enum Class BlockFace

java.lang.Object
java.lang.Enum<BlockFace>
cn.nukkit.math.BlockFace
所有已实现的接口:
Serializable, Comparable<BlockFace>, Constable

public enum BlockFace extends Enum<BlockFace>
  • 枚举常量详细资料

  • 方法详细资料

    • values

      public static BlockFace[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      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.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值
    • getHorizontals

      public static BlockFace[] getHorizontals()
    • fromIndex

      public static BlockFace fromIndex(int index)
      Get a BlockFace by it's index (0-5). The order is D-U-N-S-W-E
      参数:
      index - BlockFace index
      返回:
      block face
    • fromHorizontalIndex

      public static BlockFace fromHorizontalIndex(int index)
      Get a BlockFace by it's horizontal index (0-3). The order is S-W-N-E
      参数:
      index - BlockFace index
      返回:
      block face
    • fromHorizontalAngle

      public static BlockFace fromHorizontalAngle(double angle)
      Get the BlockFace corresponding to the given angle (0-360). An angle of 0 is SOUTH, an angle of 90 would be WEST
      参数:
      angle - horizontal angle
      返回:
      block face
    • fromAxis

      public static BlockFace fromAxis(BlockFace.AxisDirection axisDirection, BlockFace.Axis axis)
    • random

      public static BlockFace random(Random rand)
      Choose a random BlockFace using the given Random
      参数:
      rand - random number generator
      返回:
      block face
    • getIndex

      public int getIndex()
      Get the index of this BlockFace (0-5). The order is D-U-N-S-W-E
      返回:
      index
    • getDUNESWIndex

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getDUNESWIndex()
      Get the index of this BlockFace (0-5). The order is D-U-N-E-S-W
      返回:
      index
    • getDUSWNEIndex

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getDUSWNEIndex()
      Get the index of this BlockFace (0-5). The order is D-U-S-W-N-E
      返回:
      index
    • getHorizontalIndex

      public int getHorizontalIndex()
      Get the horizontal index of this BlockFace (0-3). The order is S-W-N-E
      返回:
      horizontal index
    • getHorizontalAngle

      public float getHorizontalAngle()
      Get the angle of this BlockFace (0-360)
      返回:
      horizontal angle
    • getName

      public String getName()
      Get the name of this BlockFace (up, down, north, etc.)
      返回:
      name
    • getAxis

      public BlockFace.Axis getAxis()
      Get the Axis of this BlockFace
      返回:
      axis
    • getAxisDirection

      public BlockFace.AxisDirection getAxisDirection()
      Get the AxisDirection of this BlockFace
      返回:
      axis direction
    • getUnitVector

      public Vector3 getUnitVector()
      Get the unit vector of this BlockFace
      返回:
      vector
    • getXOffset

      public int getXOffset()
      Returns an offset that addresses the block in front of this BlockFace
      返回:
      x offset
    • getYOffset

      public int getYOffset()
      Returns an offset that addresses the block in front of this BlockFace
      返回:
      y offset
    • getZOffset

      public int getZOffset()
      Returns an offset that addresses the block in front of this BlockFace
      返回:
      x offset
    • getOpposite

      public BlockFace getOpposite()
      Get the opposite BlockFace (e.g. DOWN ==> UP)
      返回:
      block face
    • rotateY

      public BlockFace rotateY()
      Rotate this BlockFace around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => NORTH)
      返回:
      block face
    • rotateYCCW

      public BlockFace rotateYCCW()
      Rotate this BlockFace around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)
      返回:
      block face
    • getCompassRoseDirection

      @PowerNukkitOnly @Since("1.4.0.0-PN") public CompassRoseDirection getCompassRoseDirection()
    • getEdges

      @Since("FUTURE") @PowerNukkitOnly public Set<BlockFace> getEdges()
    • toString

      public String toString()
      覆盖:
      toString 在类中 Enum<BlockFace>