Package wtf.choco.veinminer.util
Enum Class BlockFace
- All Implemented Interfaces:
Serializable
,Comparable<BlockFace>
,Constable
Represents a block face.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDown (y -1).East (x +1).East down (x +1, y -1).East up (x +1, y +1).North (z -1).North down (y -1, z -1).North east (x +1, z -1).North up (y +1, z -1).North west (x -1, z -1).South (z +1).South down (y -1, z +1).South east (x +1, z +1).South up (y +1, z +1).South west (x -1, z +1).Up (y +1).West (x -1).West down (x -1, y -1).West up (x -1, y +1). -
Method Summary
Modifier and TypeMethodDescription@NotNull BlockFace
Get theBlockFace
opposite to this BlockFace.@NotNull BlockPosition
getRelative
(@NotNull BlockPosition position) Get aBlockPosition
offset by thisBlockFace
's offset coordinates relative to the given BlockPosition.int
Get the x offset of this block face.int
Get the y offset of this block face.int
Get the z offset of this block face.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
-
NORTH
North (z -1). -
EAST
East (x +1). -
SOUTH
South (z +1). -
WEST
West (x -1). -
UP
Up (y +1). -
DOWN
Down (y -1). -
NORTH_EAST
North east (x +1, z -1). -
NORTH_WEST
North west (x -1, z -1). -
SOUTH_EAST
South east (x +1, z +1). -
SOUTH_WEST
South west (x -1, z +1). -
NORTH_UP
North up (y +1, z -1). -
EAST_UP
East up (x +1, y +1). -
SOUTH_UP
South up (y +1, z +1). -
WEST_UP
West up (x -1, y +1). -
NORTH_DOWN
North down (y -1, z -1). -
EAST_DOWN
East down (x +1, y -1). -
SOUTH_DOWN
South down (y -1, z +1). -
WEST_DOWN
West down (x -1, y -1).
-
-
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
-
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
Get theBlockFace
opposite to this BlockFace. Note that this works only for cardinal faces (up, down, east, west, north, and south). Any other face will throw anUnsupportedOperationException
.- Returns:
- the opposite block face
-
getRelative
Get aBlockPosition
offset by thisBlockFace
's offset coordinates relative to the given BlockPosition.- Parameters:
position
- the block of reference- Returns:
- the relative block
-