本文整理汇总了Java中net.minecraftforge.common.config.ConfigElement类的典型用法代码示例。如果您正苦于以下问题:Java ConfigElement类的具体用法?Java ConfigElement怎么用?Java ConfigElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigElement类属于net.minecraftforge.common.config包,在下文中一共展示了ConfigElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private static @Nonnull List<IConfigElement> getConfigElements() {
final List<IConfigElement> list = new ArrayList<IConfigElement>();
for (final String cat : Config.getConfig().getCategoryNames()) {
final ConfigCategory cc = Config.getConfig().getCategory(cat);
if (cc.isChild())
continue;
final ConfigElement ce = new ConfigElement<String>(cc);
list.add(ce);
}
return list;
}
示例2: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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();
}
示例3: buildChildScreen
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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"));
}
示例4: getElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
/** Create configuration element list */
private static List<IConfigElement> getElements() {
ArrayList<IConfigElement> list = new ArrayList<IConfigElement>();
List<IConfigElement> listGeneral = new ConfigElement(
ThaumOresMod.config.getInstance().getCategory(TOConfig.categoryGeneral)).getChildElements();
List<IConfigElement> listDebug = new ConfigElement(
ThaumOresMod.config.getInstance().getCategory(TOConfig.categoryDebug)).getChildElements();
List<IConfigElement> listGeneration = new ConfigElement(
ThaumOresMod.config.getInstance().getCategory(TOConfig.categoryGeneration)).getChildElements();
list.add(new DummyCategoryElement(TOConfig.categoryGeneral, TOConfig.categoryGeneral, listGeneral));
list.add(new DummyCategoryElement(TOConfig.categoryDebug, TOConfig.categoryDebug, listDebug));
list.add(new DummyCategoryElement(TOConfig.categoryGeneration, TOConfig.categoryGeneration, listGeneration));
return list;
}
示例5: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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;
}
示例6: buildChildScreen
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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.func_135052_a("forge.configgui.ctgy.forgeChunkLoadingConfig"));
}
示例7: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private static @Nonnull List<IConfigElement> getConfigElements() {
final List<IConfigElement> list = new ArrayList<IConfigElement>();
for (final String cat : Config.getConfig().getCategoryNames()) {
final ConfigCategory cc = Config.getConfig().getCategory(cat);
if (cc.isChild())
continue;
final ConfigElement ce = new ConfigElement<String>(cc);
list.add(ce);
}
return list;
}
示例8: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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;
}
示例9: buildChildScreen
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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
);
}
示例10: getElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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;
}
示例11: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements() {
final List<IConfigElement> list = new ArrayList<IConfigElement>();
for (final String cat : ConfigHandler.instance.getCategoryNames()) {
final ConfigCategory cc = ConfigHandler.instance.getCategory(cat);
if (cc.isChild())
continue;
final ConfigElement ce = new ConfigElement<String>(cc);
list.add(ce);
}
return list;
}
示例12: buildChildScreen
import net.minecraftforge.common.config.ConfigElement; //导入依赖的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"));
}
示例13: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> ret = new ArrayList();
Configuration config = NeiLotr.mod.getConfig().getConfigFile();
for (String category : config.getCategoryNames()) {
ret.addAll(new ConfigElement(config.getCategory(category)).getChildElements());
}
return ret;
}
示例14: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
ArrayList<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new ConfigElement(Config.getInstance().FeatureControl));
list.add(new ConfigElement(Config.getInstance().Samples));
list.add(new ConfigElement(Config.getInstance().UserEntries));
return list;
}
示例15: getConfigElements
import net.minecraftforge.common.config.ConfigElement; //导入依赖的package包/类
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> configElements = new ArrayList<IConfigElement>();
Configuration config = ModConfig.CONFIG;
if (config != null) {
ConfigCategory categoryClient = config.getCategory(ModConfig.CLIENT_CAT);
configElements.addAll(new ConfigElement(categoryClient).getChildElements());
}
return configElements;
}