diff options
author | Linnea Gräf <nea@nea.moe> | 2024-08-31 11:59:47 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-08-31 11:59:47 +0200 |
commit | 816f80f862d2f5de6bc9b0ae84cd6df0da341228 (patch) | |
tree | ee8aaccbaebe5a024549c2530319ed09a02cc4e4 /src/compat/configured/java/ConfiguredCompat.kt | |
parent | d2f240ff0ca0d27f417f837e706c781a98c31311 (diff) | |
download | Firmament-816f80f862d2f5de6bc9b0ae84cd6df0da341228.tar.gz Firmament-816f80f862d2f5de6bc9b0ae84cd6df0da341228.tar.bz2 Firmament-816f80f862d2f5de6bc9b0ae84cd6df0da341228.zip |
Add configured compat
[no changelog]
Diffstat (limited to 'src/compat/configured/java/ConfiguredCompat.kt')
-rw-r--r-- | src/compat/configured/java/ConfiguredCompat.kt | 29 |
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) } + } + } +} |