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


Java Configuration.getCategory方法代码示例

本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getCategory方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getCategory方法的具体用法?Java Configuration.getCategory怎么用?Java Configuration.getCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.config.Configuration的用法示例。


在下文中一共展示了Configuration.getCategory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupBookConfig

import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static void setupBookConfig(Configuration cfg) {
    ConfigCategory category = cfg.getCategory(CATEGORY_BOOKS);
    if (category.isEmpty()) {
        // Initialize with defaults
        addBook(cfg, Items.BOOK.getRegistryName().toString(), "*");
        addBook(cfg, Items.ENCHANTED_BOOK.getRegistryName().toString(), "*");
        addBook(cfg, Items.WRITABLE_BOOK.getRegistryName().toString(), "*");
        addBook(cfg, Items.WRITTEN_BOOK.getRegistryName().toString(), "*");
        addBook(cfg, "rftools:rftools_manual", BookType.BOOK_BLUE.getModel());
        addBook(cfg, "rftoolscontrol:rftoolscontrol_manual", BookType.BOOK_GREEN.getModel());
        addBook(cfg, "rftoolsdim:rftoolsdim_manual", BookType.BOOK_GREEN.getModel());
        addBook(cfg, "deepresonance:dr_manual", BookType.BOOK_RED.getModel());
    } else {
        for (Map.Entry<String, Property> entry : category.entrySet()) {
            validBooks.put(entry.getKey(), entry.getValue().getString());
        }
    }
}
 
开发者ID:McJty,项目名称:Lector,代码行数:19,代码来源:GeneralConfiguration.java

示例2: getConfigElements

import net.minecraftforge.common.config.Configuration; //导入方法依赖的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;
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:10,代码来源:GuiModConfig.java

示例3: buildChildScreen

import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Override
protected GuiScreen buildChildScreen() {
	Configuration config = VExConfig.getConfig();
	ConfigElement categoryBlocks = new ConfigElement(config.getCategory(VExConfig.CATEGORY_NAME_BLOCKS));
	List<IConfigElement> propertiesOnScreen = categoryBlocks.getChildElements();
	String windowTitle = I18n.format("gui.config.category.blocks");
	return new GuiConfig(owningScreen, propertiesOnScreen, owningScreen.modID,
			this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
			this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
}
 
开发者ID:IvanSteklow,项目名称:VanillaExtras,代码行数:11,代码来源:VExGuiFactory.java

示例4: getConfigElements

import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements() {
	List<IConfigElement> configElements = new ArrayList<IConfigElement>();

	Configuration config = Config.getConfig();
	if (config != null) {
		ConfigCategory category = config.getCategory(Config.getCategory());
		configElements.addAll(new ConfigElement(category).getChildElements());
	}

	return configElements;
}
 
开发者ID:mezz,项目名称:ItemZoom,代码行数:12,代码来源:ItemZoomModConfigGui.java

示例5: InitClientMessage

import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public InitClientMessage(Configuration conf) {
	ConfigCategory cat = conf.getCategory("default building targets");
	this.sentryTargets = cat.get("Attack on hurt").getBoolean() ? 1 : 0;
	this.sentryTargets += cat.get("Attack other players").getBoolean() ? 2 : 0;
	this.sentryTargets += cat.get("Attack hostile mobs").getBoolean() ? 4 : 0;
	this.sentryTargets += cat.get("Attack friendly creatures").getBoolean() ? 8 : 0;
	this.dispenserPlayer = cat.get("Dispensers heal neutral players").getBoolean();
	this.teleporterPlayer = cat.get("Neutral players can teleport").getBoolean();
	this.teleporterEntity = cat.get("Entities can teleport").getBoolean();
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:11,代码来源:TF2Message.java

示例6: loadConfig

import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
static void loadConfig(File configurationFile)
{
    config = new Configuration(configurationFile);

    Property bl = config.get("items", "blacklist", new String[0]);
    bl.setComment("List of items to disallow from placing in the belt.");

    Property wl = config.get("items", "whitelist", new String[0]);
    wl.setComment("List of items to force-allow placing in the belt. Takes precedence over blacklist.");

    Property showBeltOnPlayersProperty = config.get("display", "showBeltOnPlayers", true);
    showBeltOnPlayersProperty.setComment("If set to FALSE, the belts and tools will NOT draw on players.");

    Property beltItemScaleProperty = config.get("display", "beltItemScale", 0.5);
    beltItemScaleProperty.setComment("Changes the scale of items on the belt.");

    Property releaseToSwapProperty = config.get("input", "releaseToSwap", false);
    releaseToSwapProperty.setComment("If set to TRUE, releasing the menu key (R) will activate the swap. Requires a click otherwise (default).");

    Property clipMouseToCircleProperty = config.get("input", "clipMouseToCircle", false);
    clipMouseToCircleProperty.setComment("If set to TRUE, the radial menu will try to prevent the mouse from leaving the outer circle.");

    Property allowClickOutsideBoundsProperty = config.get("input", "allowClickOutsideBounds", false);
    allowClickOutsideBoundsProperty.setComment("If set to TRUE, the radial menu will allow clicking outside the outer circle to activate the items.");

    display = config.getCategory("display");
    display.setComment("Options for customizing the display of tools on the player");

    input = config.getCategory("input");
    input.setComment("Options for customizing the interaction with the radial menu");

    showBeltOnPlayers = showBeltOnPlayersProperty.getBoolean();
    beltItemScale = (float)beltItemScaleProperty.getDouble();

    releaseToSwap = releaseToSwapProperty.getBoolean();
    clipMouseToCircle = clipMouseToCircleProperty.getBoolean();
    allowClickOutsideBounds = allowClickOutsideBoundsProperty.getBoolean();

    blackListString.addAll(Arrays.asList(bl.getStringList()));
    whiteListString.addAll(Arrays.asList(wl.getStringList()));
    if (!bl.wasRead() ||
            !wl.wasRead() ||
            !releaseToSwapProperty.wasRead() ||
            !showBeltOnPlayersProperty.wasRead() ||
            !beltItemScaleProperty.wasRead() ||
            !clipMouseToCircleProperty.wasRead() ||
            !allowClickOutsideBoundsProperty.wasRead())
    {
        config.save();
    }
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:52,代码来源:Config.java


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