Search in sources :

Example 1 with DummyCategoryElement

use of net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement 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 2 with DummyCategoryElement

use of net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement 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 3 with DummyCategoryElement

use of net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement 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 4 with DummyCategoryElement

use of net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement 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)

Example 5 with DummyCategoryElement

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

the class CavelandConfigEntry method getConfigElements.

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

Aggregations

DummyCategoryElement (net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)10 IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)10 ArrayList (java.util.ArrayList)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 IEnderIOAddon (crazypants.enderio.api.addon.IEnderIOAddon)1 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)1 ConfigElement (net.minecraftforge.common.config.ConfigElement)1 Configuration (net.minecraftforge.common.config.Configuration)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1