Search in sources :

Example 1 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project AgriCraft by AgriCraft.

the class AgriCraftGuiConfig method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> configElements = new ArrayList<>();
    for (AgriConfigCategory e : AgriConfigCategory.values()) {
        String descr = "AgriCraft " + e.getDisplayName() + " Settings";
        String name = "agricraft.configgui.ctgy." + e.name();
        configElements.add(new DummyConfigElement.DummyCategoryElement(descr, name, new ConfigElement(CoreHandler.getConfig().getCategory(e.name().toLowerCase())).getChildElements()));
    }
    return configElements;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) AgriConfigCategory(com.agricraft.agricore.config.AgriConfigCategory) ArrayList(java.util.ArrayList) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 2 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project VoodooCraft by Mod-DevCafeTeam.

the class VoodooConfig method getEntries.

public static List<IConfigElement> getEntries() {
    List<IConfigElement> entries = new ArrayList<IConfigElement>();
    Set<String> categories = config.getCategoryNames();
    Iterator<String> i = categories.iterator();
    while (i.hasNext()) {
        String categoryName = i.next();
        ConfigCategory category = config.getCategory(categoryName);
        entries.addAll(new ConfigElement(category).getChildElements());
    }
    return entries;
}
Also used : ConfigCategory(net.minecraftforge.common.config.ConfigCategory) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 3 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project Charset by CharsetMC.

the class ConfigGui method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    Configuration config = ModCharset.configModules;
    List<IConfigElement> list = Lists.newArrayList(new ConfigElement(config.getCategory("general").get("profile")), new DummyConfigElement.DummyCategoryElement("categories", "config.charset.categories.name", getSubConfigElements(config, "categories", ConfigElement::new)), new DummyConfigElement.DummyCategoryElement("overrides", "config.charset.overrides.name", getSubConfigElements(config, "overrides", ConfigElement::new)));
    List<String> modulesWithConfigs = Lists.newArrayList(ModuleLoader.moduleConfigs.keySet());
    Collections.sort(modulesWithConfigs);
    for (String s : modulesWithConfigs) {
        List<IConfigElement> clist = null;
        String clsName = ModuleLoader.moduleGuiClasses.get(s);
        if (clsName != null && clsName.length() > 0) {
            try {
                clist = ((ICharsetModuleConfigGui) Class.forName(clsName).newInstance()).createConfigElements();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (clist == null) {
            clist = generateList(ModuleLoader.moduleConfigs.get(s));
        }
        list.add(new DummyConfigElement.DummyCategoryElement(s, "config.charset." + s + ".name", clist));
    }
    return list;
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 4 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project TUMAT by canitzp.

the class GuiConf method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<>();
    for (int i = 0; i < ConfigCats.values().length; i++) {
        ConfigCats cat = ConfigCats.values()[i];
        ConfigHandler.config.setCategoryComment(cat.name, cat.desc);
        list.add(new ConfigElement(ConfigHandler.config.getCategory(cat.name)));
    }
    return list;
}
Also used : ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigCats(de.canitzp.tumat.configuration.cats.ConfigCats) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 5 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement 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)

Aggregations

ConfigElement (net.minecraftforge.common.config.ConfigElement)14 IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)13 ArrayList (java.util.ArrayList)11 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)6 Property (net.minecraftforge.common.config.Property)3 DummyConfigElement (net.minecraftforge.fml.client.config.DummyConfigElement)3 AgriConfigCategory (com.agricraft.agricore.config.AgriConfigCategory)1 DummyConfigElement (cpw.mods.fml.client.config.DummyConfigElement)1 IConfigElement (cpw.mods.fml.client.config.IConfigElement)1 ConfigCats (de.canitzp.tumat.configuration.cats.ConfigCats)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Configuration (net.minecraftforge.common.config.Configuration)1 DummyCategoryElement (net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)1