Search in sources :

Example 11 with ConfigElement

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

Example 12 with ConfigElement

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

the class BCConfigElement method getChildElements.

@Override
public List<IConfigElement> getChildElements() {
    if (!isProp) {
        List<IConfigElement> elements = new ArrayList<>();
        Iterator<ConfigCategory> ccI = cat.getChildren().iterator();
        Iterator<Property> pI = cat.getOrderedValues().iterator();
        while (ccI.hasNext()) {
            ConfigCategory child = ccI.next();
            if (!child.parent.getQualifiedName().equals(cat.getQualifiedName())) {
                continue;
            }
            ConfigElement temp = new BCConfigElement(child);
            if (temp.showInGui()) {
                elements.add(temp);
            }
        }
        while (pI.hasNext()) {
            ConfigElement temp = new ConfigElement(pI.next());
            if (temp.showInGui()) {
                elements.add(temp);
            }
        }
        return elements;
    } else {
        return null;
    }
}
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) Property(net.minecraftforge.common.config.Property) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 13 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project DynamicSurroundings by OreCruncher.

the class DynSurroundConfigGui method addConfigElement.

private void addConfigElement(@Nonnull final String category, @Nonnull final String prop) {
    final Property property = this.config.getCategory(category).get(prop);
    this.configElements.add(new ConfigElement(property));
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) Property(net.minecraftforge.common.config.Property)

Example 14 with ConfigElement

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

the class ForestryGuiConfig method getConfigCategories.

private static List<IConfigElement> getConfigCategories() {
    List<IConfigElement> configElements = new ArrayList<>();
    LocalizedConfiguration configCommon = Config.configCommon;
    if (configCommon != null) {
        List<String> commonCategoryNames = Arrays.asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world");
        for (String categoryName : commonCategoryNames) {
            ConfigCategory category = configCommon.getCategory(categoryName);
            configElements.add(new ConfigElement(category));
        }
    }
    LocalizedConfiguration configFluid = Config.configFluid;
    if (configFluid != null) {
        List<String> fluidCategoryNames = Arrays.asList("enableFluid", "enableFluidBlock");
        for (String categoryName : fluidCategoryNames) {
            ConfigCategory category = configFluid.getCategory(categoryName);
            configElements.add(new ConfigElement(category));
        }
    }
    return configElements;
}
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

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