Search in sources :

Example 1 with ConfigCategory

use of net.minecraftforge.common.config.ConfigCategory in project MinecraftForge by MinecraftForge.

the class ForgeChunkManager method addConfigProperty.

public static void addConfigProperty(Object mod, String propertyName, String value, Property.Type type) {
    ModContainer container = getContainer(mod);
    if (container != null) {
        ConfigCategory cat = config.getCategory(container.getModId());
        Property prop = new Property(propertyName, value, type).setLanguageKey("forge.configgui." + propertyName);
        if (type == Property.Type.INTEGER) {
            prop.setMinValue(0);
        }
        cat.put(propertyName, prop);
    }
}
Also used : ModContainer(net.minecraftforge.fml.common.ModContainer) ConfigCategory(net.minecraftforge.common.config.ConfigCategory) Property(net.minecraftforge.common.config.Property)

Example 2 with ConfigCategory

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

use of net.minecraftforge.common.config.ConfigCategory in project MorePlanets by SteveKunG.

the class ConfigManagerMP method getConfigElements.

public static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<>();
    ConfigCategory configGeneral = ConfigManagerMP.config.getCategory(ConfigManagerMP.GENERAL);
    configGeneral.setComment(GCCoreUtil.translate("gui.config.mp.general"));
    list.add(new ConfigElement(configGeneral));
    ConfigCategory configDimension = ConfigManagerMP.config.getCategory(ConfigManagerMP.DIMENSIONS);
    configDimension.setComment(GCCoreUtil.translate("gui.config.mp.dimension"));
    list.add(new ConfigElement(configDimension));
    ConfigCategory configGCAddon = ConfigManagerMP.config.getCategory(ConfigManagerMP.GC_ADDON_COMPAT);
    configGCAddon.setComment(GCCoreUtil.translate("gui.config.mp.gcaddon"));
    list.add(new ConfigElement(configGCAddon));
    ConfigCategory configGUIs = ConfigManagerMP.config.getCategory(ConfigManagerMP.OTHERS);
    configGUIs.setComment(GCCoreUtil.translate("gui.config.mp.other"));
    list.add(new ConfigElement(configGUIs));
    return list;
}
Also used : ConfigCategory(net.minecraftforge.common.config.ConfigCategory) ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Aggregations

ConfigCategory (net.minecraftforge.common.config.ConfigCategory)3 ArrayList (java.util.ArrayList)2 ConfigElement (net.minecraftforge.common.config.ConfigElement)2 IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)2 Property (net.minecraftforge.common.config.Property)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1