diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-27 17:26:42 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-27 17:26:42 +0100 |
commit | 8df225399f1932b8824d2fc44f4c964bc47fc6aa (patch) | |
tree | a2f1d7f64f68242aaaa5b97df2c15665eb7d12ce /src/main/kotlin/gui/config/EnumRenderer.kt | |
parent | ccb5c556def69ea16a52c00b3fbfe3a224f51ac2 (diff) | |
download | Firmament-8df225399f1932b8824d2fc44f4c964bc47fc6aa.tar.gz Firmament-8df225399f1932b8824d2fc44f4c964bc47fc6aa.tar.bz2 Firmament-8df225399f1932b8824d2fc44f4c964bc47fc6aa.zip |
feat: Add pickobulus blocker on private island
Diffstat (limited to 'src/main/kotlin/gui/config/EnumRenderer.kt')
-rw-r--r-- | src/main/kotlin/gui/config/EnumRenderer.kt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/kotlin/gui/config/EnumRenderer.kt b/src/main/kotlin/gui/config/EnumRenderer.kt new file mode 100644 index 0000000..3b80b7e --- /dev/null +++ b/src/main/kotlin/gui/config/EnumRenderer.kt @@ -0,0 +1,15 @@ +package moe.nea.firmament.gui.config + +import net.minecraft.text.Text + +interface EnumRenderer<E : Any> { + fun getName(option: ManagedOption<E>, value: E): Text + + companion object { + fun <E : Enum<E>> default() = object : EnumRenderer<E> { + override fun getName(option: ManagedOption<E>, value: E): Text { + return Text.translatable(option.rawLabelText + ".choice." + value.name.lowercase()) + } + } + } +} |