当前位置: 首页>>代码示例>>Java>>正文


Java IConfigEntry类代码示例

本文整理汇总了Java中cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry的典型用法代码示例。如果您正苦于以下问题:Java IConfigEntry类的具体用法?Java IConfigEntry怎么用?Java IConfigEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IConfigEntry类属于cpw.mods.fml.client.config.GuiConfigEntries包,在下文中一共展示了IConfigEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GuiConfig

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. titleLine2 is specified in this constructor.
 * If a non-null value is passed for configID, the OnConfigChanged and PostConfigChanged events will be posted when the Done button is 
 * pressed if any configElements were changed (includes child screens). If configID is not defined, the events will be posted if the parent 
 * gui is null or if the parent gui is not an instance of GuiConfig.
 *
 * @param parentScreen the parent GuiScreen object
 * @param configElements a List of IConfigProperty objects
 * @param modID the mod ID for the mod whose config settings will be edited
 * @param configID an identifier that will be passed to the OnConfigChanged and PostConfigChanged events
 * @param allRequireWorldRestart send true if all configElements on this screen require a world restart
 * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted
 * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being
 *            edited.
 * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category
 *            currently being edited.
 */
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID, 
        boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
    this.field_146297_k = Minecraft.func_71410_x();
    this.parentScreen = parentScreen;
    this.configElements = configElements;
    this.entryList = new GuiConfigEntries(this, field_146297_k);
    this.initEntries = new ArrayList<IConfigEntry>(entryList.listEntries);
    this.allRequireWorldRestart = allRequireWorldRestart;
    this.allRequireMcRestart = allRequireMcRestart;
    this.modID = modID;
    this.configID = configID;
    this.isWorldRunning = field_146297_k.field_71441_e != null;
    if (title != null)
        this.title = title;
    this.titleLine2 = titleLine2;
    if (this.titleLine2 != null && this.titleLine2.startsWith(" > "))
        this.titleLine2 = this.titleLine2.replaceFirst(" > ", "");
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:38,代码来源:GuiConfig.java

示例2: GuiConfig

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. titleLine2 is specified in this constructor.
 * If a non-null value is passed for configID, the OnConfigChanged and PostConfigChanged events will be posted when the Done button is 
 * pressed if any configElements were changed (includes child screens). If configID is not defined, the events will be posted if the parent 
 * gui is null or if the parent gui is not an instance of GuiConfig.
 *
 * @param parentScreen the parent GuiScreen object
 * @param configElements a List of IConfigProperty objects
 * @param modID the mod ID for the mod whose config settings will be edited
 * @param configID an identifier that will be passed to the OnConfigChanged and PostConfigChanged events
 * @param allRequireWorldRestart send true if all configElements on this screen require a world restart
 * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted
 * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being
 *            edited.
 * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category
 *            currently being edited.
 */
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID, 
        boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
    this.mc = Minecraft.getMinecraft();
    this.parentScreen = parentScreen;
    this.configElements = configElements;
    this.entryList = new GuiConfigEntries(this, mc);
    this.initEntries = new ArrayList<IConfigEntry>(entryList.listEntries);
    this.allRequireWorldRestart = allRequireWorldRestart;
    this.allRequireMcRestart = allRequireMcRestart;
    this.modID = modID;
    this.configID = configID;
    this.isWorldRunning = mc.theWorld != null;
    if (title != null)
        this.title = title;
    this.titleLine2 = titleLine2;
    if (this.titleLine2 != null && this.titleLine2.startsWith(" > "))
        this.titleLine2 = this.titleLine2.replaceFirst(" > ", "");
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:37,代码来源:GuiConfig.java

示例3: DummyCategoryElement

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
    super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
    this.childElements = childElements;
    this.configEntryClass = customListEntryClass;
    isProperty = false;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:9,代码来源:DummyConfigElement.java

示例4: enabled

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * By overriding the enabled() method and checking the value of the "enabled" entry this entry is enabled/disabled based on the value of
 * the other entry. 
 */
@Override
public boolean enabled()
{
    for (IConfigEntry entry : this.owningEntryList.listEntries)
    {
        if (entry.getName().equals("enabled") && entry instanceof BooleanEntry)
        {
            return Boolean.valueOf(entry.getCurrentValue().toString());
        }
    }
    
    return true;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:18,代码来源:ForgeGuiFactory.java

示例5: undoChanges

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * Since adding a new entry to the child screen is what constitutes a change here, reset the child
 * screen listEntries to the saved list.
 */
@Override
public void undoChanges()
{
    if (childScreen instanceof GuiConfig)
    {
        GuiConfig child = (GuiConfig) childScreen;
        for (IConfigEntry ice : child.entryList.listEntries)
            if (!child.initEntries.contains(ice) && ForgeChunkManager.getConfig().hasCategory(ice.getName()))
                ForgeChunkManager.getConfig().removeCategory(ForgeChunkManager.getConfig().getCategory(ice.getName()));
        
        child.entryList.listEntries = new ArrayList<IConfigEntry>(child.initEntries);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:18,代码来源:ForgeGuiFactory.java

示例6: setCategoryConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * Sets the custom IConfigEntry class that should be used in place of the standard entry class (which is just a button that
 * navigates into the category). This class MUST provide a constructor with the following parameter types: {@code GuiConfig} (the parent
 * GuiConfig screen will be provided), {@code GuiPropertyList} (the parent GuiPropertyList will be provided), {@code IConfigElement}
 * (the IConfigElement for this Property will be provided).
 */
public Configuration setCategoryConfigEntryClass(String category, Class<? extends IConfigEntry> clazz)
{
    
    if (!caseSensitiveCustomCategories)
        category = category.toLowerCase(Locale.ENGLISH);
    getCategory(category).setConfigEntryClass(clazz);
    return this;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:15,代码来源:Configuration.java

示例7: DummyCategoryElement

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
    super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
    this.childElements = childElements;
    this.configEntryClass = customListEntryClass;
    isProperty = false;
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:8,代码来源:DummyConfigElement.java

示例8: setCategoryConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/**
 * Sets the custom IConfigEntry class that should be used in place of the standard entry class (which is just a button that
 * navigates into the category). This class MUST provide a constructor with the following parameter types: {@code GuiConfig} (the parent
 * GuiConfig screen will be provided), {@code GuiPropertyList} (the parent GuiPropertyList will be provided), {@code IConfigElement}
 * (the IConfigElement for this Property will be provided).
 */
public JarConfiguration setCategoryConfigEntryClass(String category, @SuppressWarnings("rawtypes") final Class<? extends IConfigEntry> clazz)
{
    
    if (!caseSensitiveCustomCategories)
        category = category.toLowerCase(Locale.ENGLISH);
    getCategory(category).setConfigEntryClass(clazz);
    return this;
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:15,代码来源:JarConfiguration.java

示例9: getEntry

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/** Gets the config entry for a setting in this GUI. */
public IConfigEntry getEntry(Setting setting) {
	for (IConfigEntry entry : entryList.listEntries)
		if (setting.fullName.equals(entry.getName()))
			return entry;
	return null;
}
 
开发者ID:copygirl,项目名称:copycore,代码行数:8,代码来源:GuiConfigBase.java

示例10: getCategoryEntry

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
/** Gets the config entry for a category in this GUI. */
public CategoryElement.Entry getCategoryEntry(String category) {
	for (IConfigEntry entry : entryList.listEntries)
		if ((entry instanceof CategoryEntry) &&
		    category.equals(entry.getName()))
			return (CategoryElement.Entry)entry;
	return null;
}
 
开发者ID:copygirl,项目名称:copycore,代码行数:9,代码来源:GuiConfigBase.java

示例11: setCustomListEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
{
    this.configEntryClass = clazz;
    return this;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:DummyConfigElement.java

示例12: setConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
{
    this.configEntryClass = clazz;
    return this;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:DummyConfigElement.java

示例13: getConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
    return configEntryClass;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:DummyConfigElement.java

示例14: getConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
    return isProperty ? prop.getConfigEntryClass() : ctgy.getConfigEntryClass();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:ConfigElement.java

示例15: setConfigEntryClass

import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; //导入依赖的package包/类
public ConfigCategory setConfigEntryClass(Class<? extends IConfigEntry> clazz)
{
    this.customEntryClass = clazz;
    return this;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:ConfigCategory.java


注:本文中的cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。