Enum Class BlockFace
- All Implemented Interfaces:
Serializable, Comparable<BlockFace>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionfaceFromDir(Vector3Di dir) Get the blockFace from adirectionVectorvalue.static Vector3DigetDirection(BlockFace myFace) Get thedirectionVectorof thisBlockFacestatic BlockFacegetOpposite(BlockFace dir) Get theBlockFacethat's the exact opposite of the provided one.static @Nullable UnaryOperator<BlockFace> getRotationFunction(MovementDirection movementDirection) Get the appropriate function for rotating a BlockFace.static intGets the integer value of aBlockFace.static BlockFacerotate(BlockFace blockFace, int steps, @Nullable UnaryOperator<BlockFace> rotationFunction) Rotate a block face in a given direction for a number of steps.static BlockFacerotate(BlockFace blockFace, int steps, MovementDirection direction) Rotate a block face in a given direction for a number of steps.static BlockFacerotateClockwise(BlockFace myFace) Rotate theBlockFacein clockwise direction from a perspective of looking down on the world.static BlockFacerotateCounterClockwise(BlockFace myFace) Rotate theBlockFacein counterclockwise direction from a perspective of looking down on the world.static BlockFacerotateVerticallyEast(BlockFace curFace) Rotate theBlockFacein eastern direction on the vertical plane.static BlockFacerotateVerticallyNorth(BlockFace curFace) Rotate theBlockFacein northern direction on the vertical plane.static BlockFacerotateVerticallySouth(BlockFace curFace) Rotate theBlockFacein southern direction on the vertical plane.static BlockFacerotateVerticallyWest(BlockFace curFace) Rotate theBlockFacein western direction on the vertical plane.static BlockFacevalueOf(int val) Returns the enum constant of this class with the specified name.static BlockFaceReturns 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
-
EAST
-
SOUTH
-
WEST
-
UP
-
DOWN
-
NONE
-
-
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
-
getOpposite
-
getValue
-
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:
val- 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
-
getDirection
-
rotateClockwise
-
rotateCounterClockwise
-
rotateVerticallyNorth
-
rotateVerticallySouth
-
rotateVerticallyEast
-
rotateVerticallyWest
-
faceFromDir
-
getRotationFunction
public static @Nullable UnaryOperator<BlockFace> getRotationFunction(MovementDirection movementDirection) Get the appropriate function for rotating a BlockFace. Different rotation directions use different methods.- Parameters:
movementDirection- TheMovementDirectionto rotate in.- Returns:
- The appropriate function for rotating the
BlockFacein the given direction.
-
rotate
public static BlockFace rotate(BlockFace blockFace, int steps, @Nullable UnaryOperator<BlockFace> rotationFunction) Rotate a block face in a given direction for a number of steps. -
rotate
Rotate a block face in a given direction for a number of steps.
-