diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/util/math/BlockRotation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/util/math/BlockRotation.kt index 216c46405..ba2eecd3d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/util/math/BlockRotation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/util/math/BlockRotation.kt @@ -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 + } + } + } } /**