From 0ab411fd90f8da90a2785970cb095035e3d5bf86 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 3 Jan 2024 15:11:39 +0700 Subject: [PATCH] Add "none" to BlockRotationFreedom --- .../dbotthepony/mc/otm/core/math/BlockRotationFreedom.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/BlockRotationFreedom.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/BlockRotationFreedom.kt index 8a7328ca5..6cb7926f4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/BlockRotationFreedom.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/BlockRotationFreedom.kt @@ -57,7 +57,9 @@ enum class BlockRotationFreedom(vararg values: BlockRotation) { BlockRotation.SOUTH_DOWN, BlockRotation.WEST_DOWN, BlockRotation.EAST_DOWN, - ); + ), + + NONE(BlockRotation.NORTH); val possibleValues: Collection get() = property.possibleValues val property: EnumProperty = EnumProperty.create("facing", BlockRotation::class.java, *values) @@ -66,14 +68,14 @@ enum class BlockRotationFreedom(vararg values: BlockRotation) { private val twoDirection = EnumMap>(Direction::class.java) init { - for (direction in Direction.values()) { + for (direction in Direction.entries) { oneDirection[direction] = possibleValues.firstOrNull { it.front == direction } ?: possibleValues.first() val second = EnumMap(Direction::class.java) twoDirection[direction] = second - for (direction2 in Direction.values()) { + for (direction2 in Direction.entries) { second[direction2] = possibleValues.firstOrNull { it.front == direction && it.top == direction2 } ?: possibleValues.firstOrNull { it.front == direction } ?: possibleValues.first()