Add RelativeSide#defaultOf
This commit is contained in:
parent
167ea42ec8
commit
9e1ae327ea
@ -20,7 +20,21 @@ operator fun BlockPos.plus(other: BlockRotation): BlockPos {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class RelativeSide(val default: Direction) {
|
enum class RelativeSide(val default: Direction) {
|
||||||
FRONT(Direction.NORTH), BACK(Direction.SOUTH), LEFT(Direction.WEST), RIGHT(Direction.EAST), TOP(Direction.UP), BOTTOM(Direction.DOWN)
|
FRONT(Direction.NORTH), BACK(Direction.SOUTH), LEFT(Direction.WEST), RIGHT(Direction.EAST), TOP(Direction.UP), BOTTOM(Direction.DOWN);
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun defaultOf(direction: Direction): RelativeSide {
|
||||||
|
return when (direction) {
|
||||||
|
Direction.DOWN -> BOTTOM
|
||||||
|
Direction.UP -> TOP
|
||||||
|
Direction.NORTH -> FRONT
|
||||||
|
Direction.SOUTH -> BACK
|
||||||
|
Direction.WEST -> LEFT
|
||||||
|
Direction.EAST -> RIGHT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user