當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。