Enum Class BlockFace
- All Implemented Interfaces:
Serializable
,Comparable<BlockFace>
,Constable
The
BlockFace
enum contains constants for the different valid faces in the minecraft protocol.- Since:
- 1.7.8
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BlockFace
getBlockFaceByValue
(int face) getCCW()
getCW()
short
int
Returns an integer representing cardinal directions with south as the starting index at 0.static BlockFace
getLegacyBlockFaceByValue
(int face) int
getModX()
int
getModY()
int
getModZ()
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.
-
Enum Constant Details
-
DOWN
-Y offset -
UP
+Y offset -
NORTH
-Z offset -
SOUTH
+Z offset -
WEST
-X offset -
EAST
+X offset -
OTHER
Face is set to 255
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getLegacyBlockFaceByValue
-
getBlockFaceByValue
-
getModX
public int getModX() -
getModY
public int getModY() -
getModZ
public int getModZ() -
getOppositeFace
-
getCCW
-
getCW
-
getHorizontalId
public int getHorizontalId()Returns an integer representing cardinal directions with south as the starting index at 0. UP and DOWN return -1Used 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()
-