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/ConfiguredConfigScreenProvider.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/ConfiguredConfigScreenProvider.kt')
-rw-r--r-- | src/compat/configured/java/ConfiguredConfigScreenProvider.kt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compat/configured/java/ConfiguredConfigScreenProvider.kt b/src/compat/configured/java/ConfiguredConfigScreenProvider.kt new file mode 100644 index 0000000..c0095bf --- /dev/null +++ b/src/compat/configured/java/ConfiguredConfigScreenProvider.kt @@ -0,0 +1,22 @@ +package moe.nea.firmament.compat.configured + +import com.google.auto.service.AutoService +import com.mrcrayfish.configured.integration.CatalogueConfigFactory +import net.fabricmc.loader.api.FabricLoader +import net.minecraft.client.gui.screen.Screen +import moe.nea.firmament.Firmament +import moe.nea.firmament.gui.config.FirmamentConfigScreenProvider + +@AutoService(FirmamentConfigScreenProvider::class) +class ConfiguredConfigScreenProvider : FirmamentConfigScreenProvider { + override val key: String + get() = "configured" + override val isEnabled: Boolean + get() = FabricLoader.getInstance().isModLoaded("configured") + + override fun open(parent: Screen?): Screen { + return CatalogueConfigFactory.createConfigScreen( + parent, + FabricLoader.getInstance().getModContainer(Firmament.MOD_ID).get()) + } +} |