aboutsummaryrefslogtreecommitdiff
path: root/src/compat/configured/java/ConfiguredCompat.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat/configured/java/ConfiguredCompat.kt')
-rw-r--r--src/compat/configured/java/ConfiguredCompat.kt29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/compat/configured/java/ConfiguredCompat.kt b/src/compat/configured/java/ConfiguredCompat.kt
new file mode 100644
index 0000000..a5b78bb
--- /dev/null
+++ b/src/compat/configured/java/ConfiguredCompat.kt
@@ -0,0 +1,29 @@
+package moe.nea.firmament.compat.configured
+
+import com.mrcrayfish.configured.api.IConfigEntry
+import com.mrcrayfish.configured.api.IModConfig
+import com.mrcrayfish.configured.api.IModConfigProvider
+import com.mrcrayfish.configured.api.ModContext
+import moe.nea.firmament.Firmament
+import moe.nea.firmament.gui.config.AllConfigsGui
+
+/**
+ * Registered in `fabric.mod.json` at `custom.configured.providers`
+ */
+class ConfiguredCompat : IModConfigProvider {
+ override fun getConfigurationsForMod(modContext: ModContext): Set<IModConfig> {
+ if (modContext.modId != Firmament.MOD_ID) return emptySet()
+ return buildSet {
+ add(object : BaseConfig() {
+ override fun getRoot(): IConfigEntry {
+ return BaseConfigNode
+ }
+
+ override fun getTranslationKey(): String? {
+ return "firmament.config.all-configs"
+ }
+ })
+ AllConfigsGui.allConfigs.mapTo(this) { ConfigCategory(it) }
+ }
+ }
+}