This commit is contained in:
DBotThePony 2023-01-31 00:30:59 +07:00
parent c5c2a3a3cb
commit 99e1f94fb5
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,11 @@ operator fun BlockPos.plus(other: BlockRotation): BlockPos {
} }
/** /**
* [top] clarifies about block's top facing direction, NOT bottom * Represents unique block orientation in space, by providing [front] and [top] directions
*
* Allows to get relative faces through [left], [right], [bottom] and [back]
*
* @see BlockRotationFreedom
*/ */
enum class BlockRotation( enum class BlockRotation(
val front: Direction, val front: Direction,

View File

@ -14,6 +14,9 @@ internal inline val BlockState.facingOne: Direction get() = this[BlockRotationFr
internal inline val BlockState.facingTwo: Direction get() = this[BlockRotationFreedom.TWO.property].front internal inline val BlockState.facingTwo: Direction get() = this[BlockRotationFreedom.TWO.property].front
internal inline val BlockState.facingThree: Direction get() = this[BlockRotationFreedom.THREE.property].front internal inline val BlockState.facingThree: Direction get() = this[BlockRotationFreedom.THREE.property].front
/**
* Controls the rotational freedom of block in space, employing [property] and [of] to get valid value from set of possible values
*/
enum class BlockRotationFreedom(vararg values: BlockRotation) { enum class BlockRotationFreedom(vararg values: BlockRotation) {
ONE( ONE(
BlockRotation.NORTH, BlockRotation.NORTH,