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


Java ConfigCategory.entrySet方法代码示例

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


在下文中一共展示了ConfigCategory.entrySet方法的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: 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

示例3: 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

示例4: handleTreePopulation

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private void handleTreePopulation(ConfigCategory treePopulationCategory) {
	for (ConfigCategory treeConfig: treePopulationCategory.getChildren()) {
		String treeName = treeConfig.getName();
		
		int percentageChancePerChunk = 0;
		int treesPerChunk = 0;
		for (Entry<String, Property> entry : treeConfig.entrySet()) {
			if (entry.getKey().equals(Population.PercentageChancePerTreeConfigKey)) {
				percentageChancePerChunk = entry.getValue().getInt();
			}
			else if (entry.getKey().equals(Population.TreesPerChunkConfigKey)) {
				treesPerChunk = entry.getValue().getInt();
			}
		}
		
		Population population = new Population(percentageChancePerChunk, treesPerChunk);
		
		treePopulation.put(KTreeCfgTrees.getTreeConfiguration(treeName), population);
	}
}
 
开发者ID:vidaj,项目名称:BigTrees,代码行数:21,代码来源:BiomeConfiguration.java

示例5: handleBiometypes

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private void handleBiometypes(ConfigCategory child) {
	for(Entry<String, Property> entry : child.entrySet()) {
		Property property = entry.getValue();
		String propertyName = property.getName();
		
		if (propertyName.toLowerCase().equalsIgnoreCase("Included")) {
			includedBiomeTypes = toBiomeTypes(property.getStringList());
		} else if (propertyName.equalsIgnoreCase("Excluded")) {
			excludedBiomeTypes = toBiomeTypes(property.getStringList());
		} else if (propertyName.equalsIgnoreCase("Specific")) {
			for (String specificBiomeName : property.getStringList()) {
				specificBiomes.add(specificBiomeName.toLowerCase());
			}
		} else {
			FMLLog.getLogger().warn("Skipping biome configuration due to unknown property name '%s'", propertyName);
		}
	}
}
 
开发者ID:vidaj,项目名称:BigTrees,代码行数:19,代码来源:BiomeConfiguration.java

示例6: loadGeneralSettings

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static void loadGeneralSettings(Configuration config) {
	ConfigCategory generalSettings = config.getCategory("general");
	
	for(Map.Entry<String, Property> entry : generalSettings.entrySet()) {
		String key = entry.getKey();
		Property property = entry.getValue();
		
		if (key.equals("Enable roots")) {
			KTreeCfg.rootsEnable = property.getBoolean();
		}
		else if (key.equals("Enabled dimension ids")) {
			KTreeCfg.enabledDimensionIds = toSet(property.getIntList());
		}
		else if (key.equals("Disabled dimension ids")) {
			KTreeCfg.disabledDimensionIds = toSet(property.getIntList());
		}
	}
}
 
开发者ID:vidaj,项目名称:BigTrees,代码行数:19,代码来源:KTreeCfgBiomes.java

示例7: convertConfig

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
/**
 * Provide comparability for older versions
 */
public void convertConfig(){
    MacroKey.instance.configuration.load();
    Map<String, Property> map = Maps.newHashMap();

    ConfigCategory category = MacroKey.instance.configuration.getCategory("bindings");
    for (Map.Entry<String, Property> entry : category.entrySet()) {
        BoundKey.addKeybinding(new BoundKey(Integer.parseInt(entry.getKey()), entry.getValue().getString(), false, true));
    }
}
 
开发者ID:Matts,项目名称:MacroKey,代码行数:13,代码来源:JsonConfig.java

示例8: scrubCategory

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static void scrubCategory(final ConfigCategory category) {
	final List<String> killList = new ArrayList<String>();
	for (final Entry<String, Property> entry : category.entrySet())
		if (StringUtils.isEmpty(entry.getValue().getComment()))
			killList.add(entry.getKey());

	for (final String kill : killList)
		category.remove(kill);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:10,代码来源:ModOptions.java

示例9: 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

示例10: 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


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