Add RelativeSide#defaultOf

This commit is contained in:
DBotThePony 2025-04-03 15:36:19 +07:00
parent 167ea42ec8
commit 9e1ae327ea
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -20,7 +20,21 @@ operator fun BlockPos.plus(other: BlockRotation): BlockPos {
}
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
}
}
}
}
/**