Search in sources :

Example 6 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project EnderIO by SleepyTrousers.

the class GuiConfigFactoryEIO method getConfigElements.

/*
   * Note: We are using the Forge config structure to build our GUI. This makes our ConfigElementEio a bit hacky, so it would be better to keep our own tree in
   * ValueFactory.
   */
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> result = new ArrayList<>();
    List<ModContainer> modList = Loader.instance().getModList();
    for (ModContainer modContainer : modList) {
        Object mod = modContainer.getMod();
        if (mod instanceof IEnderIOAddon) {
            Configuration configuration = ((IEnderIOAddon) mod).getConfiguration();
            if (configuration != null) {
                List<IConfigElement> list = new ArrayList<>();
                for (String section : configuration.getCategoryNames()) {
                    final ConfigCategory category = configuration.getCategory(section);
                    category.setLanguageKey(EnderIO.lang.addPrefix("config." + category.getQualifiedName()));
                    if (!category.isChild()) {
                        list.add(new ConfigElementEio(category));
                    }
                }
                result.add(new DummyCategoryElement(modContainer.getName(), EnderIO.lang.addPrefix("config.title." + modContainer.getModId()), list));
            }
        }
    }
    return result;
}
Also used : ModContainer(net.minecraftforge.fml.common.ModContainer) Configuration(net.minecraftforge.common.config.Configuration) ConfigCategory(net.minecraftforge.common.config.ConfigCategory) ArrayList(java.util.ArrayList) IEnderIOAddon(crazypants.enderio.api.addon.IEnderIOAddon) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) DummyCategoryElement(net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)

Example 7 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project Waddles by GirafiStudios.

the class GuiFactory method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<>();
    List<IConfigElement> general = new ConfigElement(ConfigurationHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements();
    List<IConfigElement> spawnChances = new ConfigElement(ConfigurationHandler.config.getCategory(ConfigurationHandler.CATEGORY_PENGUIN_SPAWNS)).getChildElements();
    list.add(new DummyConfigElement.DummyCategoryElement("General", new ResourceLocation(Reference.MOD_ID, "config.category.general").toString(), general));
    list.add(new DummyConfigElement.DummyCategoryElement("Spawn Chances", new ResourceLocation(Reference.MOD_ID, "config.category.spawnchances").toString(), spawnChances));
    return list;
}
Also used : ConfigElement(net.minecraftforge.common.config.ConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ResourceLocation(net.minecraft.util.ResourceLocation) ArrayList(java.util.ArrayList) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 8 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project Cavern2 by kegare.

the class CavernConfigEntry method getConfigElements.

@Override
protected List<IConfigElement> getConfigElements() {
    List<IConfigElement> ret = super.getConfigElements();
    ret.add(new DummyCategoryElement("cavern:cavernBiomes", Config.LANG_KEY + "biomes", CavernBiomesEntry.class));
    ret.add(new DummyCategoryElement("cavern:cavernVeins", Config.LANG_KEY + "veins", CavernVeinsEntry.class));
    return ret;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) DummyCategoryElement(net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)

Example 9 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project Cavern2 by kegare.

the class DimensionConfigEntry method getConfigElements.

@Override
protected List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = Lists.newArrayList();
    list.add(new DummyCategoryElement("cavern:cavernConfig", Config.LANG_KEY + "dimension.cavern", CavernConfigEntry.class));
    list.add(new DummyCategoryElement("cavern:hugeCavernConfig", Config.LANG_KEY + "dimension.hugeCavern", HugeCavernConfigEntry.class));
    list.add(new DummyCategoryElement("cavern:aquaCavernConfig", Config.LANG_KEY + "dimension.aquaCavern", AquaCavernConfigEntry.class));
    list.add(new DummyCategoryElement("cavern:mirageWorldsConfig", Config.LANG_KEY + "dimension.mirageWorlds", MirageWorldsConfigEntry.class));
    return list;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) DummyCategoryElement(net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)

Example 10 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project Cavern2 by kegare.

the class HugeCavernConfigEntry method getConfigElements.

@Override
protected List<IConfigElement> getConfigElements() {
    List<IConfigElement> ret = super.getConfigElements();
    ret.add(new DummyCategoryElement("cavern:hugeCavernBiomes", Config.LANG_KEY + "biomes", HugeCavernBiomesEntry.class));
    ret.add(new DummyCategoryElement("cavern:hugeCavernVeins", Config.LANG_KEY + "veins", HugeCavernVeinsEntry.class));
    return ret;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) DummyCategoryElement(net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)

Aggregations

IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)24 ArrayList (java.util.ArrayList)14 ConfigElement (net.minecraftforge.common.config.ConfigElement)11 DummyCategoryElement (net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)10 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)7 DummyConfigElement (net.minecraftforge.fml.client.config.DummyConfigElement)5 Configuration (net.minecraftforge.common.config.Configuration)2 Property (net.minecraftforge.common.config.Property)2 DisplayConfigEntry (cavern.client.config.common.DisplayConfigEntry)1 GeneralConfigEntry (cavern.client.config.common.GeneralConfigEntry)1 MiningAssistConfigEntry (cavern.client.config.common.MiningAssistConfigEntry)1 DimensionConfigEntry (cavern.client.config.dimension.DimensionConfigEntry)1 AgriConfigCategory (com.agricraft.agricore.config.AgriConfigCategory)1 IEnderIOAddon (crazypants.enderio.api.addon.IEnderIOAddon)1 ConfigCats (de.canitzp.tumat.configuration.cats.ConfigCats)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 IConfigEntry (net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1