aboutsummaryrefslogtreecommitdiff
path: root/src/compat/configured/java/ConfiguredConfigScreenProvider.kt
blob: c0095bfa576fcf5b85040a4615e5b794469f25d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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())
    }
}