net.minecraftforge.fml.client.config.IConfigElement Java Examples

The following examples show how to use net.minecraftforge.fml.client.config.IConfigElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 6 votes vote down vote up
protected static IConfigElement createFeatureEntries(String modId) {
	final AbstractFeatureManager manager = FeatureRegistry.instance.getManager(modId);
	if (manager == null) return null;

	final List<IConfigElement> categories = Lists.newArrayList();

	for (String category : manager.getCategories()) {
		List<IConfigElement> categoryEntries = Lists.newArrayList();
		for (String feature : manager.getFeaturesInCategory(category)) {
			final Property property = FeatureRegistry.instance.getProperty(modId, category, feature);
			if (property != null) categoryEntries.add(new ConfigElement(property));
		}

		categories.add(new CategoryElement(category, "openmodslib.config.features." + category, categoryEntries));
	}

	return new CategoryElement("features", "openmodslib.config.features", categories);
}
 
Example #2
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 6 votes vote down vote up
private static IConfigElement createConfigEntries(String modId) {
	final ModConfig config = ConfigProcessing.getConfig(modId);
	if (config == null) return null;

	final List<IConfigElement> categories = Lists.newArrayList();

	for (String category : config.getCategories()) {
		final List<IConfigElement> categoryEntries = Lists.newArrayList();
		for (String value : config.getValues(category)) {
			final ConfigPropertyMeta meta = config.getValue(category, value);
			categoryEntries.add(new ConfigElement(meta.getProperty()));
		}

		categories.add(new CategoryElement(category, "openmodslib.config.category." + category, categoryEntries));
	}

	return new CategoryElement("config", "openmodslib.config.config", categories, EntryWithWarning.class);
}
 
Example #3
Source File: SPConfigGUI.java    From Sound-Physics with GNU General Public License v3.0 5 votes vote down vote up
/** Compiles a list of config elements */
private static List<IConfigElement> getConfigElements() 
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();
  
    //Add categories to config GUI
    list.add(categoryElement(SoundPhysicsCore.configFile.CATEGORY_GENERAL, "General", "soundphysics.configgui.ctgy.general"));
    list.add(categoryElement(SoundPhysicsCore.Config.categoryPerformance, "Performance", "soundphysics.configgui.ctgy.performance"));
    list.add(categoryElement(SoundPhysicsCore.Config.categoryMaterialProperties, "Material Properties", "soundphysics.configgui.ctgy.materialProperties"));
    list.add(categoryElement(SoundPhysicsCore.Config.categoryMisc, "Misc", "soundphysics.configgui.ctgy.misc"));
  
    return list;
}
 
Example #4
Source File: AgriCraftGuiConfig.java    From AgriCraft with MIT License 5 votes vote down vote up
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;
}
 
Example #5
Source File: EnderUtilitiesGuiFactory.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> configElements = new ArrayList<IConfigElement>();

    Configuration config = ConfigReader.loadConfigsFromFile();
    configElements.add(new ConfigElement(config.getCategory(ConfigReader.CATEGORY_GENERIC)));
    configElements.add(new ConfigElement(config.getCategory(ConfigReader.CATEGORY_BUILDERSWAND)));
    configElements.add(new ConfigElement(config.getCategory(ConfigReader.CATEGORY_LISTS)));
    configElements.add(new ConfigElement(config.getCategory(ConfigReader.CATEGORY_CLIENT)));

    return configElements;
}
 
Example #6
Source File: GuiConfigFactoryEnderZoo.java    From EnderZoo with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
  List<IConfigElement> list = new ArrayList<IConfigElement>();
  String prefix = "enderzoo.config.";

  for (Section section : Config.sections) {
    list.add(new ConfigElement(Config.config.getCategory(section.lc()).setLanguageKey(prefix + section.lang)));
  }

  return list;
}
 
Example #7
Source File: GuiConfigComplex.java    From LunatriusCore with MIT License 5 votes vote down vote up
private static List<IConfigElement> getConfigElements(final Configuration configuration, final String langPrefix) {
    final List<IConfigElement> elements = new ArrayList<IConfigElement>();
    for (final String name : configuration.getCategoryNames()) {
        final ConfigCategory category = configuration.getCategory(name).setLanguageKey(langPrefix + ".category." + name);
        if (category.parent == null) {
            elements.add(new ConfigElement(category));
        }
    }

    return elements;
}
 
Example #8
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 5 votes vote down vote up
private static List<IConfigElement> createDefaultConfigElements(String modId, List<IConfigElement> result) {
	{
		final IConfigElement features = createFeatureEntries(modId);
		if (features != null) result.add(features);
	}

	{
		final IConfigElement config = createConfigEntries(modId);
		if (config != null) result.add(config);
	}

	return result;
}
 
Example #9
Source File: SPConfigGUI.java    From Sound-Physics with GNU General Public License v3.0 4 votes vote down vote up
/** Creates a button linking to another screen where all options of the category are available */
private static IConfigElement categoryElement(String category, String name, String tooltip_key) 
{
    return new DummyConfigElement.DummyCategoryElement(name, tooltip_key,
            new ConfigElement(SoundPhysicsCore.configFile.getCategory(category)).getChildElements());
}
 
Example #10
Source File: GuiConfigSimple.java    From LunatriusCore with MIT License 4 votes vote down vote up
private static List<IConfigElement> getConfigElements(final Configuration configuration, final String categoryName) {
    final ConfigElement element = new ConfigElement(configuration.getCategory(categoryName));
    return element.getChildElements();
}
 
Example #11
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 4 votes vote down vote up
private CategoryElement(String name, String langKey, List<IConfigElement> childElements) {
	super(name, langKey, childElements);
}
 
Example #12
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 4 votes vote down vote up
public CategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass) {
	super(name, langKey, childElements, customListEntryClass);
}
 
Example #13
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 4 votes vote down vote up
public EntryWithWarning(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
	super(owningScreen, owningEntryList, configElement);
}
 
Example #14
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 4 votes vote down vote up
public OpenModsConfigScreen(GuiScreen parent, String modId, String title) {
	super(parent, createDefaultConfigElements(modId, Lists.<IConfigElement> newArrayList()), modId, false, true, title);
}
 
Example #15
Source File: OpenModsConfigScreen.java    From OpenModsLib with MIT License 4 votes vote down vote up
public OpenModsConfigScreen(GuiScreen parent, String modId, String title, List<IConfigElement> customElements) {
	super(parent, createDefaultConfigElements(modId, customElements), modId, false, true, title);
}