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


Java FurnaceRecipe类代码示例

本文整理汇总了Java中org.bukkit.inventory.FurnaceRecipe的典型用法代码示例。如果您正苦于以下问题:Java FurnaceRecipe类的具体用法?Java FurnaceRecipe怎么用?Java FurnaceRecipe使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: registerRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public void registerRecipes() {
    Bukkit.resetRecipes();
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.BEETROOT_SOUP)).shape(new String[] {"rrr", "rrr", " b "}).setIngredient('r', MaterialList.BEETROOT).setIngredient('b', org.bukkit.Material.BOWL));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.END_BRICKS)).shape(new String[] {"ee", "ee"}).setIngredient('e', org.bukkit.Material.ENDER_STONE));
    
    //Purpur block recipes
    addRecipe(new FurnaceRecipe(new ItemStack(MaterialList.CHORUS_FRUIT_POPPED), MaterialList.CHORUS_FRUIT));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_BLOCK, 4)).shape(new String[] {"pp", "pp"}).setIngredient('p', MaterialList.CHORUS_FRUIT_POPPED));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"p  ", "pp ", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"  p", " pp", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_SLAB, 6)).shape(new String[] {"ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_PILLAR)).shape(new String[] {"s", "s"}).setIngredient('s', MaterialList.PURPUR_SLAB));
    
    //Arrows
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.SPECTRAL_ARROW, 2)).shape(new String[] {" d ", "dad", " d "}).setIngredient('d', org.bukkit.Material.GLOWSTONE_DUST).setIngredient('a', org.bukkit.Material.ARROW));
}
 
开发者ID:MCCarbon,项目名称:Carbon-2,代码行数:17,代码来源:Injector.java

示例2: setupRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static void setupRecipes() {
    for (String key : SensibleToolbox.getItemRegistry().getItemIds()) {
        // add custom workbench recipes
        BaseSTBItem item = SensibleToolbox.getItemRegistry().getItemById(key);
        Recipe r = item.getRecipe();
        if (r != null) {
            Bukkit.addRecipe(r);
        }
        for (Recipe r2 : item.getExtraRecipes()) {
            Bukkit.addRecipe(r2);
        }

        // add custom furnace recipes
        ItemStack stack = item.getSmeltingResult();
        if (stack != null) {
            Bukkit.addRecipe(new FurnaceRecipe(stack, item.getMaterialData()));
            recordReverseSmelt(stack, item.toItemStack());
        }

        // add custom processing recipes for any machine items
        if (item instanceof BaseSTBMachine) {
            ((BaseSTBMachine) item).addCustomRecipes(CustomRecipeManager.getManager());
        }
    }
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:26,代码来源:RecipeUtil.java

示例3: addCustomRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
@Override
public void addCustomRecipes(CustomRecipeManager crm) {
    // add a corresponding smelter recipe for every known vanilla furnace recipe
    Iterator<Recipe> iter = Bukkit.recipeIterator();
    while (iter.hasNext()) {
        Recipe r = iter.next();
        if (r instanceof FurnaceRecipe) {
            FurnaceRecipe fr = (FurnaceRecipe) r;
            if (RecipeUtil.isVanillaSmelt(fr.getInput().getType())) {
                crm.addCustomRecipe(new SimpleCustomRecipe(this, fr.getInput(), fr.getResult(), getProcessingTime(fr.getInput())));
            }
        }
    }

    // add a processing recipe for any STB item which reports itself as smeltable
    for (String key : SensibleToolbox.getItemRegistry().getItemIds()) {
        BaseSTBItem item = SensibleToolbox.getItemRegistry().getItemById(key);
        if (item.getSmeltingResult() != null) {
            ItemStack stack = item.toItemStack();
            crm.addCustomRecipe(new SimpleCustomRecipe(this, stack, item.getSmeltingResult(), getProcessingTime(stack)));
        }
    }
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:24,代码来源:Smelter.java

示例4: parseSmeltingRecipe

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public Recipe parseSmeltingRecipe(MapModuleContext context, Element elRecipe) throws InvalidXMLException {
    MaterialPattern ingredient = XMLUtils.parseMaterialPattern(XMLUtils.getRequiredUniqueChild(elRecipe, "ingredient", "i"));
    ItemStack result = parseRecipeResult(context, elRecipe);
    if(ingredient.dataMatters()) {
        return new FurnaceRecipe(result, ingredient.getMaterialData());
    } else {
        return new FurnaceRecipe(result, ingredient.getMaterial());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:10,代码来源:CraftingModule.java

示例5: getSmeltedOutput

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static ItemStack getSmeltedOutput(Material type) {
	ItemStack result = null;
	Iterator<Recipe> iter = Bukkit.recipeIterator();
	while (iter.hasNext()) {
	   Recipe recipe = iter.next();
	   if (!(recipe instanceof FurnaceRecipe)) continue;
	   if (((FurnaceRecipe) recipe).getInput().getType() != type) continue;
	   result = recipe.getResult();
	   break;
	}
	
	return result;
}
 
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:14,代码来源:RecipeCalculator.java

示例6: accept

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static <T> T accept(Recipe recipe, RecipeVisitor<T> visitor) {
    if (recipe instanceof ShapedRecipe) {
        ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
        return visitor.visit(shapedRecipe);
    } else if (recipe instanceof ShapelessRecipe) {
        ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
        return visitor.visit(shapelessRecipe);
    } else if (recipe instanceof FurnaceRecipe) {
        FurnaceRecipe furnaceRecipe = (FurnaceRecipe) recipe;
        return visitor.visit(furnaceRecipe);
    }
    return visitor.visitOther(recipe);
}
 
开发者ID:sciolizer,项目名称:craftinomicon,代码行数:14,代码来源:RecipeAcceptor.java

示例7: registerDefaultRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	Iterator<Recipe> iterator = Bukkit.recipeIterator();
	while (iterator.hasNext()) {
		Recipe r = iterator.next();
		if (r instanceof FurnaceRecipe) {
			registerRecipe(4, new ItemStack[] {((FurnaceRecipe) r).getInput()}, new ItemStack[] {r.getResult()});
		}
	}
}
 
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:11,代码来源:ElectricFurnace.java

示例8: addAllRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
static void addAllRecipes (FileConfiguration config) {
	
	if (config.getBoolean("allowFleshSmelt")) {
		Bukkit.addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER),Material.ROTTEN_FLESH));
	}
	
	if (config.getBoolean("allowJerky")){
		ShapelessRecipe jerky = new ShapelessRecipe(new ItemStack(Material.RAW_BEEF));
		jerky.addIngredient(2, Material.ROTTEN_FLESH);
		jerky.addIngredient(Material.SUGAR);
		Bukkit.addRecipe(jerky);		
	}
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:14,代码来源:BetterRecipes.java

示例9: removeAllRecipes

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
static void removeAllRecipes() {
	Recipe recipe;
	
	// Check iterator for any of our recipes, if so, remove them
	Iterator<Recipe> iter = Bukkit.recipeIterator();
	while (iter.hasNext()) {
		recipe = iter.next();
		
		// Check if this Recipe is one of the ones we are responsible for
		// First, Furnace Recipes
		try {
			if (recipe instanceof FurnaceRecipe) {
				if ((Material.LEATHER == recipe.getResult().getType()) &&
					(Material.ROTTEN_FLESH == ((FurnaceRecipe) recipe).getInput().getType())){
						iter.remove();
				}
			}
			
			// Check for our Shapeless Recipes
			if (recipe instanceof ShapelessRecipe) {
				if (Material.RAW_BEEF == recipe.getResult().getType()) {
					List<ItemStack> ingredients = ((ShapelessRecipe) recipe).getIngredientList();
					if (3 == ingredients.size() &&
						ingredients.contains(new ItemStack(Material.ROTTEN_FLESH)) &&
						ingredients.contains(new ItemStack(Material.SUGAR))) {
						iter.remove();
					}
				}
			}
		}
		catch (NullPointerException e) {
			System.out.print("[ERROR]: Failed to process Recipe iterator");
			e.printStackTrace();
			// Don't rethrow, attempt recovery
		}
	}
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:38,代码来源:BetterRecipes.java

示例10: getBurnableMaterials

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
private static Set<Material> getBurnableMaterials() {
    Set<Material> burnables = new HashSet<Material>(24);
    for (Iterator<Recipe> it = MachinaCore.plugin.getServer().recipeIterator(); it.hasNext();) {
        Recipe recipe = it.next();
        if (recipe instanceof FurnaceRecipe) {
            burnables.add(((FurnaceRecipe) recipe).getInput().getType());
        }
    }
    return burnables;
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:11,代码来源:Fuel.java

示例11: isSmelted

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static boolean isSmelted(ItemStack item) {
    if (item == null) {
        return false;
    }

    for (Recipe recipe : mcMMO.p.getServer().getRecipesFor(item)) {
        if (recipe instanceof FurnaceRecipe) {
            return MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getData());
        }
    }

    return false;
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:14,代码来源:ItemUtils.java

示例12: findVanillaFurnaceMaterials

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static void findVanillaFurnaceMaterials() {
    Iterator<Recipe> iter = Bukkit.recipeIterator();
    while (iter.hasNext()) {
        Recipe r = iter.next();
        if (r instanceof FurnaceRecipe) {
            Material mat = ((FurnaceRecipe) r).getInput().getType();
            vanillaSmelts.add(mat);
            recordReverseSmelt(r.getResult(), ((FurnaceRecipe) r).getInput());
        }
    }
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:12,代码来源:RecipeUtil.java

示例13: fromBukkitRecipe

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
    if (recipe instanceof CraftFurnaceRecipe) {
        return (CraftFurnaceRecipe) recipe;
    }
    return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:7,代码来源:CraftFurnaceRecipe.java

示例14: enable

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public void enable() {
	log("FleshToLeather:");
	plugin.getServer().addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER), Material.ROTTEN_FLESH));
	log("Enabled");
}
 
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:6,代码来源:CustomRecipies.java

示例15: FurnaceRecipe

import org.bukkit.inventory.FurnaceRecipe; //导入依赖的package包/类
public FurnaceRecipe(ItemStack result, Material source) {
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:FurnaceRecipe.java


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