类net.minecraftforge.common.config.ConfigElement源码实例Demo

下面列出了怎么用net.minecraftforge.common.config.ConfigElement的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: OpenModsLib   文件: OpenModsConfigScreen.java
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);
}
 
源代码2 项目: OpenModsLib   文件: OpenModsConfigScreen.java
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);
}
 
public YouTubeConfigurationGui(GuiScreen parentScreen) {
  super(
      parentScreen,
      new ConfigElement(
              YouTubeConfiguration.getInstance()
                  .getConfig()
                  .getCategory(Configuration.CATEGORY_GENERAL))
          .getChildElements(),
      YouTubeChat.MODID,
      false,
      false,
      "YouTube Chat");
}
 
源代码4 项目: ToroQuest   文件: GuiConfigToroQuest.java
public GuiConfigToroQuest(GuiScreen parent) {
	super (parent, new ConfigElement(ConfigurationHandler.config.getCategory(Configuration.CATEGORY_CLIENT)).getChildElements(),
			ToroQuest.MODID,
			false,
			false,
			"ToroQuest");
	titleLine2 = ConfigurationHandler.config.getConfigFile().getAbsolutePath();
}
 
源代码5 项目: Et-Futurum   文件: ConfigGUI.java
@SuppressWarnings({ "rawtypes" })
private static List<IConfigElement> getElements() {
	List<IConfigElement> list = new ArrayList<IConfigElement>();
	for (String category : ConfigurationHandler.INSTANCE.usedCategories)
		list.add(new ConfigElement(ConfigurationHandler.INSTANCE.configFile.getCategory(category)));
	return list;
}
 
public ModGuiConfig (GuiScreen parentScreen)
{
    super(parentScreen,
            new ConfigElement(ConfigurationHandler.instance().getConfigurationCategory()).getChildElements(),
            Reference.MOD_ID,
            false,
            false,
            GuiConfig.getAbridgedConfigPath(ConfigurationHandler.instance().toString()));
}
 
@SuppressWarnings({ "rawtypes" })
private static List<IConfigElement> createConfigElements() {
	ConfigCategory modules = OpenPeripheralIntegration.instance.config().getCategory(OpenPeripheralIntegration.CATEGORY_MODULES);
	modules.setLanguageKey("openperipheralintegration.config.modules");
	final ConfigElement modulesElement = new ConfigElement(modules);
	return Lists.<IConfigElement> newArrayList(modulesElement);
}
 
源代码8 项目: NEI-Integration   文件: ConfigGui.java
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    String prefix = "neiintegration.config.";
    
    for (Section configSection : Config.configSections) {
        list.add(new ConfigElement<ConfigCategory>(Config.config.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
    }
    
    return list;
}
 
源代码9 项目: AgriCraft   文件: AgriCraftGuiConfig.java
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;
}
 
源代码10 项目: enderutilities   文件: EnderUtilitiesGuiFactory.java
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;
}
 
源代码11 项目: SimplyJetpacks   文件: ConfigGui.java
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    String prefix = SimplyJetpacks.PREFIX + "config.";
    
    for (Section configSection : Config.configSections) {
        if (configSection.client) {
            list.add(new ConfigElement<ConfigCategory>(Config.configClient.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
        } else {
            list.add(new ConfigElement<ConfigCategory>(Config.config.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
        }
    }
    
    return list;
}
 
源代码12 项目: LetsModReboot   文件: ModGuiConfig.java
public ModGuiConfig(GuiScreen guiScreen)
{
    super(guiScreen,
            new ConfigElement(ConfigurationHandler.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
            Reference.MOD_ID,
            false,
            false,
            GuiConfig.getAbridgedConfigPath(ConfigurationHandler.configuration.toString()));
}
 
源代码13 项目: Electro-Magic-Tools   文件: EMTGuiConfig.java
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();

    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RANDOM.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_VALUES.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RESEARCH.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_OUTPUTS.toLowerCase())));
 list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_MODULES.toLowerCase())));

    return list;
}
 
源代码14 项目: EnderZoo   文件: GuiConfigFactoryEnderZoo.java
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;
}
 
源代码15 项目: LunatriusCore   文件: GuiConfigComplex.java
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;
}
 
源代码16 项目: PneumaticCraft   文件: GuiConfigHandler.java
private static List<IConfigElement> getConfigElements(){
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    for(String category : Config.CATEGORIES) {
        list.add(new DummyCategoryElement(category, category, new ConfigElement(Config.config.getCategory(category).setRequiresMcRestart(!Config.NO_MC_RESTART_CATS.contains(category))).getChildElements()));
    }

    return list;
}
 
源代码17 项目: OpenPeripheral   文件: ConfigGuiFactory.java
private static IConfigElement createModConfig() {
	final Configuration config = OpenPeripheralCore.instance.config();
	final List<IConfigElement> result = Lists.newArrayList();

	for (String categoryName : config.getCategoryNames()) {
		if (!categoryName.equalsIgnoreCase(Config.CATEGORY_FEATURE_GROUPS)) {
			ConfigCategory category = config.getCategory(categoryName);
			result.add(new ConfigElement(category));
		}
	}

	return new DummyCategoryElement("modConfig", "openperipheralcore.config.miscConfig", result);
}
 
源代码18 项目: Sound-Physics   文件: SPConfigGUI.java
/** 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());
}
 
源代码19 项目: NOVA-Core   文件: NovaGuiConfig.java
public NovaGuiConfig(GuiScreen parentScreen, Configuration config, String modID) {
	super(parentScreen, new ConfigElement(config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), modID, false, false, GuiConfig.getAbridgedConfigPath(config.toString()));
}
 
源代码20 项目: NOVA-Core   文件: NovaGuiConfig.java
public NovaGuiConfig(GuiScreen parentScreen, Configuration config, String modID) {
	super(parentScreen, new ConfigElement(config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), modID, false, false, GuiConfig.getAbridgedConfigPath(config.toString()));
}
 
源代码21 项目: NOVA-Core   文件: NovaGuiConfig.java
public NovaGuiConfig(GuiScreen parentScreen, Configuration config, String modID) {
	super(parentScreen, new ConfigElement<>(config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
		modID, false, false, GuiConfig.getAbridgedConfigPath(config.toString()));
}
 
源代码22 项目: Chisel-2   文件: GuiChiselConfig.java
public GuiChiselConfig(GuiScreen parent) {
	super(parent, new ConfigElement<ConfigCategory>(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Chisel.MOD_ID, false, false, GuiConfig
			.getAbridgedConfigPath(Configurations.config.toString()));
}
 
源代码23 项目: Chisel   文件: GuiChiselConfig.java
public GuiChiselConfig(GuiScreen parent)
{
    super(parent, new ConfigElement(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Chisel.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(Configurations.config.toString()));
}
 
源代码24 项目: LunatriusCore   文件: GuiConfigSimple.java
private static List<IConfigElement> getConfigElements(final Configuration configuration, final String categoryName) {
    final ConfigElement element = new ConfigElement(configuration.getCategory(categoryName));
    return element.getChildElements();
}
 
源代码25 项目: VersionChecker   文件: ConfigGUI.java
public ConfigGUI(GuiScreen parent) {
    super(parent,
            new ConfigElement(ConfigHandler.configFile.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
            Reference.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.configFile.toString()));
}
 
 类方法
 同包方法