aboutsummaryrefslogtreecommitdiff
path: root/src/compat/configured/java/ConfigNode.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat/configured/java/ConfigNode.kt')
-rw-r--r--src/compat/configured/java/ConfigNode.kt39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/compat/configured/java/ConfigNode.kt b/src/compat/configured/java/ConfigNode.kt
new file mode 100644
index 0000000..16e54a6
--- /dev/null
+++ b/src/compat/configured/java/ConfigNode.kt
@@ -0,0 +1,39 @@
+package moe.nea.firmament.compat.configured
+
+import com.mrcrayfish.configured.api.IConfigEntry
+import com.mrcrayfish.configured.api.IConfigValue
+import net.minecraft.text.Text
+import moe.nea.firmament.gui.config.ManagedConfig
+
+class ConfigNode(val config: ManagedConfig) : IConfigEntry {
+ override fun getChildren(): List<IConfigEntry> {
+ return config.allOptions.map {
+ ConfigValueNode(it.value)
+ }
+ }
+
+ override fun isRoot(): Boolean {
+ return false
+ }
+
+ override fun isLeaf(): Boolean {
+ return false
+ }
+
+ override fun getValue(): IConfigValue<*>? {
+ return null
+ }
+
+ override fun getEntryName(): String {
+ return config.translationKey
+ }
+
+ override fun getTooltip(): Text? {
+ return null
+ }
+
+ override fun getTranslationKey(): String {
+ return config.translationKey
+ }
+
+}