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


Java ConfigCategory.isEmpty方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.config.ConfigCategory.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigCategory.isEmpty方法的具體用法?Java ConfigCategory.isEmpty怎麽用?Java ConfigCategory.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.config.ConfigCategory的用法示例。


在下文中一共展示了ConfigCategory.isEmpty方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupBookConfig

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的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: JsonConfig

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public JsonConfig(File file){
    this.keybindingFile = new File(file.getParent()+"/macrokey/keybindings.json");
    this.layerFile = new File(file.getParent()+"/macrokey/layers.json");


    MacroKey.instance.boundKeys = new ArrayList<BoundKey>();
    MacroKey.instance.layers = new ArrayList<Layer>();


    File dir = new File(file.getParent()+"/macrokey/");
    if(!dir.exists()){
        dir.mkdir();
    }

    FileHelper.fileExist(keybindingFile);
    FileHelper.fileExist(layerFile);


    ConfigCategory category = MacroKey.instance.configuration.getCategory("bindings");
    if(!category.isEmpty()){
        LogHelper.info("Old Configuration File Detected! Converting...");
        convertConfig();
        MacroKey.instance.configuration.removeCategory(category);
        MacroKey.instance.configuration.save();
    }
}
 
開發者ID:Matts,項目名稱:MacroKey,代碼行數:27,代碼來源:JsonConfig.java

示例3: initGrindstoneRecipes

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void initGrindstoneRecipes(Configuration cfg) {
    ConfigCategory category = cfg.getCategory(CATEGORY_RECIPES_GRINDSTONE);
    if (category.isEmpty()) {
        // Initialize with defaults
        addRecipe(cfg, "flour", new ItemStack(Items.WHEAT), new ItemStack(ModItems.flour), 100);
        addRecipe(cfg, "bonemeal", new ItemStack(Items.BONE), new ItemStack(Items.DYE, 5, EnumDyeColor.WHITE.getDyeDamage()), 100);
        addRecipe(cfg, "flint", new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT, 2), 100);
        addRecipe(cfg, "glowstone", new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4), 300);
        addRecipe(cfg, "sugar", new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 2), 100);
        addRecipe(cfg, "blazepowder", new ItemStack(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 3), 200);
    } else {
        for (Map.Entry<String, Property> entry : category.entrySet()) {
            String[] list = entry.getValue().getStringList();
            GrindstoneRecipeRepository.addRecipe(new GrindstoneRecipe(getItem(list, 0), getItem(list, 1), getInt(list, 2)));
        }
    }
}
 
開發者ID:McJty,項目名稱:AquaMunda,代碼行數:18,代碼來源:GeneralConfiguration.java

示例4: initConfig

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
@Override
public void initConfig(Configuration cfg) {
    super.initConfig(cfg);
    maxHardness = (float) cfg.get(Config.CATEGORY_WANDS, getUnlocalizedName() + "_maxHardness", maxHardness, "Max hardness this block can move.)").getDouble();
    placeDistance = cfg.get(Config.CATEGORY_WANDS, getUnlocalizedName() + "_placeDistance", placeDistance, "Distance at which to place blocks in 'in-air' mode").getInt();

    ConfigCategory category = cfg.getCategory(Config.CATEGORY_MOVINGBLACKLIST);
    if (category.isEmpty()) {
        // Initialize with defaults
        blacklist(cfg, "tile.shieldBlock");
        blacklist(cfg, "tile.shieldBlock2");
        blacklist(cfg, "tile.shieldBlock3");
        blacklist(cfg, "tile.solidShieldBlock");
        blacklist(cfg, "tile.invisibleShieldBlock");
        setCost(cfg, "tile.mobSpawner", 5.0);
        setCost(cfg, "tile.blockAiry", 20.0);
    } else {
        for (Map.Entry<String, Property> entry : category.entrySet()) {
            blacklisted.put(entry.getKey(), entry.getValue().getDouble());
        }
    }
}
 
開發者ID:romelo333,項目名稱:notenoughwands1.8.8,代碼行數:23,代碼來源:MovingWand.java

示例5: apply

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
@Override
public boolean apply(final Object[] input) {
	final String prefix = (String) input[0];
	final InputStream stream = (InputStream) input[2];

	// The input stream contains the config file we need
	// to merge into the master.
	final JarConfiguration src = new JarConfiguration(stream);
	final ConfigCategory c = src.getCategory(CONFIG_CHESTS);

	// If the property in the chests.cfg has not been
	// initialized copy it from the ZIP.
	for (final ConfigCategory p : c.getChildren()) {
		final String name = CONFIG_CHESTS + "." + prefix + "." + p.getName();
		final ConfigCategory temp = target.getCategory(name);
		if (temp.isEmpty()) {
			for (final Entry<String, Property> item : p.getValues().entrySet()) {
				temp.put(item.getKey(), item.getValue());
			}
		}
	}

	return true;
}
 
開發者ID:OreCruncher,項目名稱:Restructured,代碼行數:25,代碼來源:ConfigProcessor.java

示例6: processTables

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void processTables(final String prefix, final Matrix2D<ItemStackWeightTable> weightTables, final JarConfiguration config) {
	for (final ScrapValue sv : ScrapValue.values())
		for (int i = 0; i < UPGRADE_NAMES.length; i++) {
			
			final String category = prefix + "_" + sv.name() + "_" + UPGRADE_NAMES[i];
			
			final ConfigCategory cc = config.getCategory(category);
			if(cc != null && !cc.isEmpty()) {
				
				final ItemStackWeightTable table = new ItemStackWeightTable();
				for(final Entry<String, Property> e: cc.getValues().entrySet()) {
					final ItemStackItem item = getItemStackItem(table, e);
					if(item != null)
						table.add(item);
				}
				weightTables.set(sv.ordinal(), i, table);
			}
		}
}
 
開發者ID:OreCruncher,項目名稱:ThermalRecycling,代碼行數:20,代碼來源:ScrappingTables.java

示例7: initCookerRecipes

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void initCookerRecipes(Configuration cfg) {
    ConfigCategory category = cfg.getCategory(CATEGORY_RECIPES_COOKER);
    if (category.isEmpty()) {
        // Initialize with defaults
        addRecipe(cfg, "cookedcarrot", new ItemStack(Items.CARROT), new ItemStack(ModItems.cookedCarrot), "", 10);
        addRecipe(cfg, "cookedpotato", new ItemStack(Items.POTATO), new ItemStack(ModItems.cookedPotato), "", 10);
        addRecipe(cfg, "vegetablesoup", new ItemStack(ModItems.choppedVegetables), ItemStackTools.getEmptyStack(), ItemDish.DISH_VEGETABLE_SOUP, 10);
    } else {
        for (Map.Entry<String, Property> entry : category.entrySet()) {
            String[] list = entry.getValue().getStringList();
            CookerRecipeRepository.addRecipe(new CookerRecipe(getItem(list, 0), getItem(list, 1), getString(list, 2), getInt(list, 3)));
        }
    }
}
 
開發者ID:McJty,項目名稱:AquaMunda,代碼行數:15,代碼來源:GeneralConfiguration.java

示例8: initCookingBoardRecipes

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void initCookingBoardRecipes(Configuration cfg) {
    ConfigCategory category = cfg.getCategory(CATEGORY_RECIPES_CUTTINGBOARD);
    if (category.isEmpty()) {
        // Initialize with defaults
        addRecipe(cfg, "chopped1", new ItemStack(Items.CARROT), new ItemStack(Items.BEETROOT), new ItemStack(Item.getItemFromBlock(Blocks.BROWN_MUSHROOM)), new ItemStack(ModItems.choppedVegetables), 2, "knife");
        addRecipe(cfg, "chopped2", new ItemStack(Items.CARROT), new ItemStack(Items.BEETROOT), new ItemStack(Item.getItemFromBlock(Blocks.RED_MUSHROOM)), new ItemStack(ModItems.choppedVegetables), 2, "knife");
        addRecipe(cfg, "dough", new ItemStack(ModItems.flour), ItemStackTools.getEmptyStack(), ItemStackTools.getEmptyStack(), new ItemStack(ModItems.dough), 10, "roller");
    } else {
        for (Map.Entry<String, Property> entry : category.entrySet()) {
            String[] list = entry.getValue().getStringList();
            boolean roller = "roller".equals(getString(list, 5));
            CuttingBoardRecipeRepository.addRecipe(new CuttingBoardRecipe(getItem(list, 0), getItem(list, 1), getItem(list, 2), getItem(list, 3), getInt(list, 4), roller));
        }
    }
}
 
開發者ID:McJty,項目名稱:AquaMunda,代碼行數:16,代碼來源:GeneralConfiguration.java

示例9: init

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void init(Configuration cfg) {
    customBlockName = cfg.get(CATEGORY_GEARSWAP, "customBlockName", "", "Put a custom block name here (format <mod>:<blockname>) to use for the modded texture gear swapper").getString();
    supportBaubles = cfg.get(CATEGORY_GEARSWAP, "supportBaubles", supportBaubles, "If true (and if Baubles in installed) we support the baubles slots").getBoolean();

    ConfigCategory rulesCategory = cfg.getCategory(CATEGORY_RULES);
    if (rulesCategory.isEmpty()) {
        // Now configured rules. Add defaults.
        cfg.get(CATEGORY_RULES, "item.extrautils:golden_bag", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Pickaxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Hammer", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Cleaver", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.LumberAxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Rapier", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Broadsword", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Longsword", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.FryPan", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Chisel", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Cutlass", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Scythe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Dagger", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Battlesign", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Battleaxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool", new String[] { "display" });
    }
    for (Map.Entry<String, Property> entry : rulesCategory.getValues().entrySet()) {
        String unlocItemName = entry.getKey();
        tagsThatHaveToMatch.put(unlocItemName, entry.getValue().getStringList());
    }

}
 
開發者ID:McJty,項目名稱:GearSwapper1.8,代碼行數:31,代碼來源:Config.java

示例10: init

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void init(Configuration cfg) {
    moddedTextureName = cfg.get(CATEGORY_GEARSWAP, "moddedTextureName", "", "Put a modded texture name here (format <mod>:<texture>) to use for the modded texture gear sappwer").getString();
    supportBaubles = cfg.get(CATEGORY_GEARSWAP, "supportBaubles", supportBaubles, "If true (and if Baubles in installed) we support the baubles slots").getBoolean();

    ConfigCategory rulesCategory = cfg.getCategory(CATEGORY_RULES);
    if (rulesCategory.isEmpty()) {
        // Now configured rules. Add defaults.
        cfg.get(CATEGORY_RULES, "item.extrautils:golden_bag", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Pickaxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Hammer", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Cleaver", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.LumberAxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Rapier", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Broadsword", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Longsword", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.FryPan", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Chisel", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Cutlass", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Scythe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Dagger", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Battlesign", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool.Battleaxe", new String[] { "display" });
        cfg.get(CATEGORY_RULES, "item.InfiTool", new String[] { "display" });
    }
    for (Map.Entry<String, Property> entry : rulesCategory.getValues().entrySet()) {
        String unlocItemName = entry.getKey();
        tagsThatHaveToMatch.put(unlocItemName, entry.getValue().getStringList());
    }

}
 
開發者ID:McJty,項目名稱:GearSwapper,代碼行數:31,代碼來源:Config.java


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