程序包 cn.nukkit.math
Enum Class BlockFace
- 所有已实现的接口:
Serializable
,Comparable<BlockFace>
,Constable
-
嵌套类概要
修饰符和类型类说明static enum
static enum
static enum
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
枚举常量概要
-
方法概要
修饰符和类型方法说明static BlockFace
fromAxis
(BlockFace.AxisDirection axisDirection, BlockFace.Axis axis) static BlockFace
fromHorizontalAngle
(double angle) Get the BlockFace corresponding to the given angle (0-360).static BlockFace
fromHorizontalIndex
(int index) Get a BlockFace by it's horizontal index (0-3).static BlockFace
fromIndex
(int index) Get a BlockFace by it's index (0-5).getAxis()
Get the Axis of this BlockFaceGet the AxisDirection of this BlockFaceint
Get the index of this BlockFace (0-5).int
Get the index of this BlockFace (0-5).getEdges()
float
Get the angle of this BlockFace (0-360)int
Get the horizontal index of this BlockFace (0-3).static BlockFace[]
int
getIndex()
Get the index of this BlockFace (0-5).getName()
Get the name of this BlockFace (up, down, north, etc.)Get the opposite BlockFace (e.g.Get the unit vector of this BlockFaceint
Returns an offset that addresses the block in front of this BlockFaceint
Returns an offset that addresses the block in front of this BlockFaceint
Returns an offset that addresses the block in front of this BlockFacestatic BlockFace
Choose a random BlockFace using the given RandomrotateY()
Rotate this BlockFace around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => NORTH)Rotate this BlockFace around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)toString()
static BlockFace
Returns the enum constant of this class with the specified name.static BlockFace[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
枚举常量详细资料
-
DOWN
-
UP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
-
方法详细资料
-
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
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 nameNullPointerException
- 如果参数为空值
-
getHorizontals
-
fromIndex
Get a BlockFace by it's index (0-5). The order is D-U-N-S-W-E- 参数:
index
- BlockFace index- 返回:
- block face
-
fromHorizontalIndex
Get a BlockFace by it's horizontal index (0-3). The order is S-W-N-E- 参数:
index
- BlockFace index- 返回:
- block face
-
fromHorizontalAngle
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
-
random
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
Get the index of this BlockFace (0-5). The order is D-U-N-E-S-W- 返回:
- index
-
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
Get the name of this BlockFace (up, down, north, etc.)- 返回:
- name
-
getAxis
Get the Axis of this BlockFace- 返回:
- axis
-
getAxisDirection
Get the AxisDirection of this BlockFace- 返回:
- axis direction
-
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
Get the opposite BlockFace (e.g. DOWN ==> UP)- 返回:
- block face
-
rotateY
Rotate this BlockFace around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => NORTH)- 返回:
- block face
-
rotateYCCW
Rotate this BlockFace around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)- 返回:
- block face
-
getCompassRoseDirection
-
getEdges
-
toString
-