本文整理匯總了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());
}
}
}
示例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)));
}
}
}
示例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());
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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());
}
}
}
示例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));
}
}
示例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);
}
示例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)));
}
}
}
示例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));
}
}
}