當前位置: 首頁>>代碼示例>>Java>>正文


Java IConfigElement類代碼示例

本文整理匯總了Java中net.minecraftforge.fml.client.config.IConfigElement的典型用法代碼示例。如果您正苦於以下問題:Java IConfigElement類的具體用法?Java IConfigElement怎麽用?Java IConfigElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IConfigElement類屬於net.minecraftforge.fml.client.config包,在下文中一共展示了IConfigElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getConfigElements

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private static List<IConfigElement> getConfigElements()
{
    PROPERTIES.clear();
    ImmutableList.Builder<IConfigElement> builder = ImmutableList.builder();
    Map<String, AuthlibLoginHelper.Data> accounts = AuthlibLoginHelper.getInstance().listAccounts();
    for (Map.Entry<String, AuthlibLoginHelper.Data> entry : accounts.entrySet())
    {
        String name = entry.getKey();
        AuthlibLoginHelper.Data data = entry.getValue();
        boolean skip = data.userid.isEmpty() && !data.accessToken.isPresent();

        String[] choices = skip ? SKIP_CHOICES.toArray(new String[0]) : LOGIN_CHOICES.toArray(new String[0]);
        Property property = new Property(name, choices[0], Property.Type.STRING, choices);
        property.setComment(skip ? SKIP_COMMENT : LOGIN_COMMENT);

        builder.add(new ConfigElement(property));
        PROPERTIES.put(name, property);
    }
    return builder.build();
}
 
開發者ID:ustc-zzzz,項目名稱:AuthlibLoginHelper,代碼行數:21,代碼來源:AuthlibLoginHelperGuiFactory.java

示例2: buildChildScreen

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
@Override
protected GuiScreen buildChildScreen()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();

    list.add(new DummyCategoryElement("forgeChunkLoadingModCfg", "forge.configgui.ctgy.forgeChunkLoadingModConfig",
            ModOverridesEntry.class));
    list.addAll((new ConfigElement(ForgeChunkManager.getDefaultsCategory())).getChildElements());

    // This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent
    // GuiConfig object's propertyList will also be refreshed to reflect the changes.
    return new GuiConfig(this.owningScreen, list, this.owningScreen.modID, "chunkLoader",
            this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
            this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
            GuiConfig.getAbridgedConfigPath(ForgeChunkManager.getConfig().toString()),
            I18n.format("forge.configgui.ctgy.forgeChunkLoadingConfig"));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:ForgeGuiFactory.java

示例3: getConfigElements

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
  List<IConfigElement> list = new ArrayList<IConfigElement>();
  String[] names = new String[]{
  		Config.CATEGORY_CLIENT,
  		Config.CATEGORY_WORLD,
  		Config.CATEGORY_ENTITY,
  		Config.CATEGORY_ITEM,
  		Config.CATEGORY_BLOCKS,
  		Config.CATEGORY_MACHINE,
  		Config.CATEGORY_MINIONS
  };
  for (String section : names) {
    list.add(new ConfigElement(CrystalMod.proxy.mainConfig.getCategory(section).setLanguageKey(Lang.prefix+"config." + section.toLowerCase())));
  }

  return list;
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:18,代碼來源:GuiConfigFactoryCM.java

示例4: getConfigElements

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> elements = new ArrayList<IConfigElement>();

    for (String name : Blockbuster.proxy.forge.getCategoryNames())
    {
        ConfigCategory category = Blockbuster.proxy.forge.getCategory(name);
        category.setLanguageKey("blockbuster.config." + name + ".title");

        if (name.indexOf(".") == -1)
        {
            elements.add(new ConfigElement(category));
        }
    }

    return elements;
}
 
開發者ID:mchorse,項目名稱:blockbuster,代碼行數:18,代碼來源:GuiConfig.java

示例5: buildChildScreen

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
@Override
protected GuiScreen buildChildScreen()
{
	Configuration configuration = ModConfiguration.getConfig();
	ConfigElement configurationCategory = new ConfigElement(configuration.getCategory(ModConfiguration.CATEGORY_NUGGETS));
	List<IConfigElement> propertiesOnThisScreen = configurationCategory.getChildElements();
	String windowTitle = I18n.format("uncrafting.options.nuggets");

	return new GuiConfig(this.owningScreen, propertiesOnThisScreen,
		this.owningScreen.modID,
		ModConfiguration.CATEGORY_NUGGETS,
		this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
		this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
		windowTitle
	);

}
 
開發者ID:crazysnailboy,項目名稱:UncraftingTable,代碼行數:18,代碼來源:ModGuiConfig.java

示例6: ReplaceIntegerEntries

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private void ReplaceIntegerEntries()
{
	for (int i = 0; i < this.entryList.listEntries.size(); i++)
	{
		IConfigEntry entry = this.entryList.listEntries.get(i);
		IConfigElement element = entry.getConfigElement();

		if (element.getType() == ConfigGuiType.INTEGER)
		{
			TextNumberSliderEntry slider = new TextNumberSliderEntry(this, this.entryList, element);
			slider.updateValueButtonText();
			this.entryList.listEntries.set(i, slider);
			this.initEntries.set(i, slider);
		}
	}
}
 
開發者ID:Brian-Wuest,項目名稱:MC-Prefab,代碼行數:17,代碼來源:GuiPrefab.java

示例7: TextNumberSliderEntry

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
public TextNumberSliderEntry(GuiConfig owningScreen,
		GuiConfigEntries owningEntryList, IConfigElement configElement) 
{
	super(owningScreen, owningEntryList, configElement, new GuiTextSlider(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18,
			"", "", Double.valueOf(configElement.getMinValue().toString()), Double.valueOf(configElement.getMaxValue().toString()),
			Double.valueOf(configElement.get().toString()), configElement.getType() == ConfigGuiType.DOUBLE, true));

	((GuiTextSlider)this.btnValue).parentEntry = this;

	if (configElement.getType() == ConfigGuiType.INTEGER)
	{
		this.beforeValue = Integer.valueOf(configElement.get().toString());
	}
	else
	{
		this.beforeValue = Double.valueOf(configElement.get().toString());
	}
}
 
開發者ID:Brian-Wuest,項目名稱:MC-Prefab,代碼行數:19,代碼來源:GuiPrefab.java

示例8: ModGuiConfigHUD

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
public ModGuiConfigHUD(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String Config) {
	super(parentScreen, configElements, modID, configID, allRequireWorldRestart, allRequireMcRestart, title, "Use right click and hold to move the map");

	if (Config.equals(Reference.catFullMapConfig)) {
		dummyMapConfig = new MapModeConfig(Reference.catFullMapConfig);
	} else if (Config.equals(Reference.catLargeMapConfig)) {
		dummyMapConfig = new LargeMapModeConfig(Reference.catLargeMapConfig);
	} else if (Config.equals(Reference.catSmallMapConfig)) {
		dummyMapConfig = new SmallMapModeConfig(Reference.catSmallMapConfig);
	}
	dummyMapConfig.setDefaults();
	dummyMapConfig.loadConfig();

	this.mw = Mw.getInstance();
	this.mapMode = new MapMode(dummyMapConfig);
	this.map = new MapRenderer(this.mw, this.mapMode, null);
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:18,代碼來源:ModGuiConfigHUD.java

示例9: ConfigFieldEntry

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
public ConfigFieldEntry(String name, String langKey, Class<?> clazz, Object instance, Map<Object, Object> parent) {
  super(name, null, getType(clazz), langKey);

  this.instance = instance;
  this.parent = parent;

  if(Map.class.isAssignableFrom(clazz)) {
    this.isProperty = false;
    ImmutableList.Builder<IConfigElement> builder = ImmutableList.builder();
    Map<Object, Object> map = ((Map<Object, Object>) instance);
    map.forEach((o, o2) -> builder.add(new ConfigFieldEntry(o.toString(), o.toString() + ".lang", o2.getClass(), o2, map)));
    this.childElements = builder.build();
    this.configEntryClass = GuiConfigEntries.CategoryEntry.class;
  }
  else {
    this.defaultValue = instance.toString();
    this.setToDefault();
  }
}
 
開發者ID:SlimeKnights,項目名稱:HarvestTweaks,代碼行數:20,代碼來源:ConfigFieldEntry.java

示例10: getElements

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
public static List<IConfigElement> getElements() {
    buttonorder.clear();
    for (int i = 0; i < JEIButtons.btnCustom.length; i++) {
        buttonorder.add("enableCustomButton." + i);
        buttonorder.add("customName." + i);
        buttonorder.add("customCommand." + i);
    }

    List<IConfigElement> entries = new ArrayList<IConfigElement>();

    for (String name : ConfigHandler.config.getCategoryNames())
        if (name.equals(ConfigHandler.CATEGORY_CUSTOM))
            entries.add(new ConfigElement(ConfigHandler.config.getCategory(name).setPropertyOrder(buttonorder)));
        else
            entries.add(new ConfigElement(ConfigHandler.config.getCategory(name)));


    return entries;
}
 
開發者ID:univrsal,項目名稱:JustEnoughButtons,代碼行數:20,代碼來源:GuiJEBConfig.java

示例11: getConfigCategories

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private static List<IConfigElement> getConfigCategories()
{
	List<IConfigElement> list = new ArrayList<IConfigElement>();
	list.add(new DummyConfigElement.DummyCategoryElement("Spawn Chances",
			"tm2.configgui.category.tmGeneral", (Class<? extends IConfigEntry>) TMGeneral.class));
	list.add(new DummyConfigElement.DummyCategoryElement(
			"Loot Spawn Chances", "tm2.configgui.category.tmLoot",
			(Class<? extends IConfigEntry>) TMLoot.class));
	list.add(new DummyConfigElement.DummyCategoryElement(
			"Configure Boolean Recipes",
			"tm2.configgui.category.tmRecipes", (Class<? extends IConfigEntry>) TMRecipes.class));
	list.add(new DummyConfigElement.DummyCategoryElement(
			"Blood Magic Integration",
			"tm2.configgui.category.tmBloodMagic", (Class<? extends IConfigEntry>) TMBloodMagic.class));
	list.add(new DummyConfigElement.DummyCategoryElement(
			"Thaumcraft Integration",
			"tm2.configgui.category.tmThaumcraft", (Class<? extends IConfigEntry>) TMTC.class));
	list.add(new DummyConfigElement.DummyCategoryElement(
			"Botania Integration", "tm2.configgui.category.tmBotania",
			(Class<? extends IConfigEntry>) TMBotania.class));
	return list;
}
 
開發者ID:TeamC4,項目名稱:Talismans2,代碼行數:23,代碼來源:TalismanConfigGUI.java

示例12: getConfigElements

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
private static List<IConfigElement> getConfigElements(Configuration config) {
    // map config elements to their categories, except for CATEGORY_GENERAL
    List<IConfigElement> list = config.getCategoryNames().stream()
        .filter(catName -> !catName.equals(Configuration.CATEGORY_GENERAL))
        .map(catName -> new ConfigElement(config.getCategory(catName)))
        .collect(Collectors.toList());

    // add props in CATEGORY_GENERAL directly to the root of the list
    if (config.hasCategory(Configuration.CATEGORY_GENERAL)) {
        ConfigCategory catGeneral = config.getCategory(Configuration.CATEGORY_GENERAL);
        List<Property> props = catGeneral.getOrderedValues();            
        list.addAll(props.stream()
            .map(prop -> new ConfigElement(prop))
            .collect(Collectors.toList())
        );
    }

    return list;
}
 
開發者ID:ata4,項目名稱:minema,代碼行數:20,代碼來源:MinemaConfigGui.java

示例13: createConfigurationCategory

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
public static IConfigElement createConfigurationCategory(Configuration config) {
    final Property property = getProperty(config);

    final TIntSet values = new TIntHashSet(property.getIntList());

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

    for (int keyCode = 0; keyCode < Keyboard.KEYBOARD_SIZE; keyCode++) {
        final String keyName = Keyboard.getKeyName(keyCode);
        if (keyName != null)
            filterList.add(new FlagArrayElement(property, values, keyCode, keyName));
    }

    final ConfigCategory category = config.getCategory(ConfigValues.CATEGORY_KEY_FILTER);
    return new DummyCategoryElement(category.getName(), category.getLanguagekey(), filterList);
}
 
開發者ID:boq,項目名稱:ClicketyClack,代碼行數:17,代碼來源:KeyFilterConfig.java

示例14: createFeatureEntries

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
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);
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:19,代碼來源:OpenModsConfigScreen.java

示例15: createConfigEntries

import net.minecraftforge.fml.client.config.IConfigElement; //導入依賴的package包/類
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);
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:19,代碼來源:OpenModsConfigScreen.java


注:本文中的net.minecraftforge.fml.client.config.IConfigElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。