Java 类org.bukkit.inventory.Recipe 实例源码

项目:CustomRecipes    文件:ListRecipesCommandExecutor.java   
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (args.length == 0) return false;

    String recipeType = args[0];
    List<? extends Recipe> recipes = recipesByTypeMapper.apply(recipeType);

    if (recipes == null) {
        sender.sendMessage(ChatColor.RED + "Unknown recipe type: " + recipeType);
        return true;
    } else if (recipes.isEmpty()) {
        sender.sendMessage(ChatColor.RED + "No recipes found for type: " + recipeType);
        return true;
    }

    return sender instanceof Player ? listPlayer((Player) sender, recipeType, recipes) : listSender(sender, recipeType, recipes);
}
项目:Uranium    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:ProjectAres    文件:CraftingModule.java   
public Recipe parseShapelessRecipe(MapModuleContext context, Element elRecipe) throws InvalidXMLException {
    ShapelessRecipe recipe = new ShapelessRecipe(parseRecipeResult(context, elRecipe));

    for(Element elIngredient : XMLUtils.getChildren(elRecipe, "ingredient", "i")) {
        MaterialPattern item = XMLUtils.parseMaterialPattern(elIngredient);
        int count = XMLUtils.parseNumber(elIngredient.getAttribute("amount"), Integer.class, 1);
        if(item.dataMatters()) {
            recipe.addIngredient(count, item.getMaterialData());
        } else {
            recipe.addIngredient(count, item.getMaterial());
        }
    }

    if(recipe.getIngredientList().isEmpty()) {
        throw new InvalidXMLException("Crafting recipe must have at least one ingredient", elRecipe);
    }

    return recipe;
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:ExilePearl    文件:TestServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
       Validate.notNull(result, "Result cannot be null");

       List<Recipe> results = new ArrayList<Recipe>();
       Iterator<Recipe> iter = recipeIterator();
       while (iter.hasNext()) {
           Recipe recipe = iter.next();
           ItemStack stack = recipe.getResult();
           if (stack.getType() != result.getType()) {
               continue;
           }
           if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
               results.add(recipe);
           }
       }
       return results;
}
项目:Thermos    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:KCauldron    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:CauldronGit    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:craftinomicon    文件:RecipeSnapshotTest.java   
@Test
public void oakPlanksHaveAtLeastOneRecipe() {
    Iterator<Recipe> iterator = Bukkit.getServer().recipeIterator();
    while (iterator.hasNext()) {
        Recipe recipe = iterator.next();
        SortedSet<ItemStack> ingredients = ingredientsGetter.getIngredients(recipe);

        boolean shownOutput = false;
        for (ItemStack ingredient : ingredients) {
            if (ingredient.getType().equals(Material.WOOD)) {
                if (!shownOutput) {
                    shownOutput = true;
                }
                MaterialData data = ingredient.getData();
            }
        }
    }
}
项目:craftinomicon    文件:RecipeSnapshotTest.java   
@Test
public void realTest() {
    MaterialRecipes materialRecipes = recipeSnapshot.getMaterialRecipes(new MaterialData(Material.WORKBENCH));
    Collection<Recipe> recipes = materialRecipes.getRecipes();
    assertEqual(recipes.size(), 1);
    Recipe first = recipes.iterator().next();
    SortedSet<ItemStack> ingredients = ingredientsGetter.getIngredients(first);
    for (ItemStack ingredient : ingredients) {
        if (ingredient != null) {
            assertEqual(ingredient.getData().getData(), (byte)-1);
        }
    }

    MaterialRecipes recipes1 = recipeSnapshot.getMaterialRecipes(new MaterialData(Material.WOOD_STAIRS));
    assertEqual(recipes1.getRecipes().size(), 1);
    Recipe theRecipe = recipes1.getRecipes().iterator().next();
    SortedSet<ItemStack> stairsIngredients = ingredientsGetter.getIngredients(theRecipe);
    for (ItemStack stairsIngredient : stairsIngredients) {
        if (stairsIngredient != null) {
            assertEqual(stairsIngredient.getData().getData(), (byte)0);
        }
    }

    Bukkit.getServer().broadcastMessage("realtest passed");
}
项目:craftinomicon    文件:RecipeSnapshotTest.java   
@Test
public void jungleWoodPlanksCanCreateCraftingTableAndJungleWoodStairs() {
    Tree planks = new Tree(Material.WOOD);
    planks.setSpecies(TreeSpecies.JUNGLE);
    MaterialRecipes materialRecipes = recipeSnapshot.getMaterialRecipes(planks);
    boolean foundWorkBench = false;
    boolean foundJungleWoodPlanks = false;
    for (Recipe recipe : materialRecipes.getUsages()) {
        ItemStack result = recipe.getResult();
        if (Material.WORKBENCH.equals(result.getType())) {
            foundWorkBench = true;
        } else if (Material.JUNGLE_WOOD_STAIRS.equals(result.getType())) {
            foundJungleWoodPlanks = true;
        }
    }
    assertEqual(true, foundWorkBench);
    assertEqual(true, foundJungleWoodPlanks);
}
项目:Cauldron-Old    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:DiffUtils    文件:CraftServer_188.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:DiffUtils    文件:CraftServer_1710.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:Zephyr    文件:BukkitItemManager.java   
@Override
public void registerItem(Item item) {
    this.itemMap.put(item.getItemName(), item);
    if (item instanceof ActionItem) {
        this.actionMap.put(item.getItemName(), (ActionItem)item);
    }
    if (item instanceof Listener) {
        Bukkit.getPluginManager().registerEvents((Listener)item, ZephyrPlugin.getInstance());
    }

    if (item.getRecipe() != null) {
        @SuppressWarnings("deprecation")
        ItemStack stack = new ItemStack(item.getItemId(), 1);
        ItemMeta meta = stack.getItemMeta();
        meta.setDisplayName(item.getItemNameColor() + item.getItemName());
        meta.setLore(item.getItemLore());
        stack.setItemMeta(meta);
        stack.setDurability((short)item.getItemData());
        Recipe recipe = createRecipe(item.getRecipe(), stack);
        Bukkit.addRecipe(recipe);
    }
}
项目:FFoKC    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:CraftBukkit    文件:RecipeIterator.java   
public Recipe next() {
    if (recipes.hasNext()) {
        removeFrom = recipes;
        return recipes.next().toBukkitRecipe();
    } else {
        net.minecraft.server.ItemStack item;
        if (smeltingCustom.hasNext()) {
            removeFrom = smeltingCustom;
            item = smeltingCustom.next();
        } else {
            removeFrom = smeltingVanilla;
            item = smeltingVanilla.next();
        }

        CraftItemStack stack = CraftItemStack.asCraftMirror(RecipesFurnace.getInstance().getResult(item));

        return new CraftFurnaceRecipe(stack, CraftItemStack.asCraftMirror(item));
    }
}
项目:CraftBukkit    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:Craftbukkit    文件:RecipeIterator.java   
public Recipe next() {
    if (recipes.hasNext()) {
        removeFrom = recipes;
        return recipes.next().toBukkitRecipe();
    } else {
        net.minecraft.server.ItemStack item;
        if (smeltingCustom.hasNext()) {
            removeFrom = smeltingCustom;
            item = smeltingCustom.next();
        } else {
            removeFrom = smeltingVanilla;
            item = smeltingVanilla.next();
        }

        CraftItemStack stack = CraftItemStack.asCraftMirror(RecipesFurnace.getInstance().getResult(item));

        return new CraftFurnaceRecipe(stack, CraftItemStack.asCraftMirror(item));
    }
}
项目:Craftbukkit    文件:CraftServer.java   
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
    Validate.notNull(result, "Result cannot be null");

    List<Recipe> results = new ArrayList<Recipe>();
    Iterator<Recipe> iter = recipeIterator();
    while (iter.hasNext()) {
        Recipe recipe = iter.next();
        ItemStack stack = recipe.getResult();
        if (stack.getType() != result.getType()) {
            continue;
        }
        if (result.getDurability() == -1 || result.getDurability() == stack.getDurability()) {
            results.add(recipe);
        }
    }
    return results;
}
项目:BelovedBlocks    文件:NetherPortalBlock.java   
@Override
public Iterable<Recipe> getCraftingRecipes()
{
    ShapedRecipe portalRecipe = new ShapedRecipe(makeItem(getAmountPerCraft()));

    portalRecipe.shape("BOB", "PCP", "OPO");

    Dye purpleDye = new Dye(Material.INK_SACK);
    purpleDye.setColor(DyeColor.PURPLE);

    portalRecipe.setIngredient('B', Material.BLAZE_POWDER);
    portalRecipe.setIngredient('O', Material.OBSIDIAN);
    portalRecipe.setIngredient('P', Material.ENDER_PEARL);
    portalRecipe.setIngredient('C', purpleDye.toItemStack(1).getData());

    return Collections.singletonList((Recipe) portalRecipe);
}
项目:BelovedBlocks    文件:Saw.java   
@Override
public Iterable<Recipe> getCraftingRecipes()
{
    ArrayList<Recipe> recipes = new ArrayList<>();

    ShapedRecipe baseRecipe = CraftingRecipes.shaped(makeItem(1), Material.STICK, Material.IRON_INGOT);

    recipes.add(CraftingRecipes.shaped(baseRecipe, "BBA", "   ", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "BBA", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "   ", "BBA"));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "ABB", "   ", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "ABB", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "   ", "ABB"));

    return recipes;
}
项目:Tweakkit-Server    文件:RecipeIterator.java   
public Recipe next() {
    if (recipes.hasNext()) {
        removeFrom = recipes;
        return recipes.next().toBukkitRecipe();
    } else {
        net.minecraft.server.ItemStack item;
        if (smeltingCustom.hasNext()) {
            removeFrom = smeltingCustom;
            item = smeltingCustom.next();
        } else {
            removeFrom = smeltingVanilla;
            item = smeltingVanilla.next();
        }

        CraftItemStack stack = CraftItemStack.asCraftMirror(RecipesFurnace.getInstance().getResult(item));

        return new CraftFurnaceRecipe(stack, CraftItemStack.asCraftMirror(item));
    }
}
项目:sensibletoolbox    文件:AutoBuilder.java   
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    ToughMachineFrame mf = new ToughMachineFrame();
    IntegratedCircuit ic = new IntegratedCircuit();
    registerCustomIngredients(mf, ic);
    recipe.shape("OCO", "DFP", "RGR");
    recipe.setIngredient('O', Material.OBSIDIAN);
    recipe.setIngredient('C', ic.getMaterialData());
    recipe.setIngredient('D', Material.DISPENSER);
    recipe.setIngredient('F', mf.getMaterialData());
    recipe.setIngredient('P', Material.DIAMOND_PICKAXE);
    recipe.setIngredient('R', Material.REDSTONE);
    recipe.setIngredient('G', Material.GOLD_INGOT);
    return recipe;
}
项目:sensibletoolbox    文件:Smelter.java   
@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)));
        }
    }
}
项目:CustomRecipes    文件:ListRecipesCommandExecutor.java   
public ListRecipesCommandExecutor(Function<String, ? extends List<? extends Recipe>> recipesByTypeMapper,
        Map<String, Function<? super Recipe, ? extends ItemStack>> recipeToItemMap,
        Map<String, BiConsumer<? super Recipe, ? super CommandSender>> recipeToCommandSenderDiplayMap) {
    this.recipesByTypeMapper = recipesByTypeMapper;
    this.recipeToItemMap = recipeToItemMap;
    this.recipeToCommandSenderDiplayMap = recipeToCommandSenderDiplayMap;
}
项目:CustomRecipes    文件:ListRecipesCommandExecutor.java   
private boolean listPlayer(Player player, String recipeType, List<? extends Recipe> recipes) {
    Function<? super Recipe, ? extends ItemStack> representationFunction = recipeToItemMap.get(recipeType);
    if (representationFunction == null) {
        player.sendMessage(ChatColor.RED + "No representation function found for this type of recipe. Trying chat messages..");
        return listSender(player, recipeType, recipes);
    }

    List<? extends ItemStack> representations = recipes.stream().map(representationFunction).collect(Collectors.toList());
    player.openInventory(new ListRecipesInventoryHolder(recipeType, representations).getInventory());

    return true;
}
项目:CustomRecipes    文件:ListRecipesCommandExecutor.java   
private boolean listSender(CommandSender sender, String recipeType, List<? extends Recipe> recipes) {
    BiConsumer<? super Recipe, ? super CommandSender> recipeDisplayFunction = recipeToCommandSenderDiplayMap.get(recipeType);
    if (recipeDisplayFunction == null) {
        sender.sendMessage(ChatColor.RED + "No display function found for this type of recpie.");
        return true;
    }

    recipes.forEach(recipe -> recipeDisplayFunction.accept(recipe, sender));

    return true;
}
项目:Uranium    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    net.minecraft.item.crafting.IRecipe recipe = ((net.minecraft.inventory.InventoryCrafting)getInventory()).currentRecipe;
    // Cauldron start - handle custom recipe classes without Bukkit API equivalents
    try {
        return recipe == null ? null : recipe.toBukkitRecipe();
    } catch (AbstractMethodError ex) {
        // No Bukkit wrapper provided
        return new CustomModRecipe(recipe);
    }
    // Cauldron end
}
项目:ProjectAres    文件:CraftingModule.java   
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());
    }
}
项目:MystiCraft    文件:SimpleWand.java   
@Override
public Recipe getRecipe() {
    ShapedRecipe r = new ShapedRecipe(baseItem);
    r.shape("  x", " y ", "x  ");
    r.setIngredient('x', Material.REDSTONE);
    r.setIngredient('y', Material.STICK);
    return r;
}
项目:Transport-Pipes    文件:CraftUtils.java   
@EventHandler
public void onPrepareCraft(PrepareItemCraftEvent e) {

    Recipe r = e.getInventory().getRecipe();
    if (r == null || e.getViewers().size() != 1) {
        return;
    }

    Player viewer = (Player) e.getViewers().get(0);

    if (r.getResult() != null) {
        DuctDetails ductDetails = DuctItemUtils.getDuctDetailsOfItem(r.getResult());
        if (ductDetails != null) {
            if (!viewer.hasPermission(ductDetails.getCraftPermission())) {
                e.getInventory().setResult(null);
                return;
            }
        } else if (DuctItemUtils.getWrenchItem().isSimilar(r.getResult())) {
            if (!viewer.hasPermission("transportpipes.craft.wrench")) {
                e.getInventory().setResult(null);
                return;
            }
        }

        if (ductDetails != null && ductDetails.getDuctType() == DuctType.PIPE) {
            boolean prevent = false;
            for (int i = 1; i < 10; i++) {
                ItemStack is = e.getInventory().getItem(i);
                if (is != null && is.getType() == Material.SKULL_ITEM && is.getDurability() == SkullType.PLAYER.ordinal()) {
                    DuctDetails isDuctDetails = DuctItemUtils.getDuctDetailsOfItem(is);
                    prevent |= isDuctDetails == null;
                }
            }
            if (prevent) {
                e.getInventory().setResult(null);
            }
        }
    }
}
项目:SurvivalAPI    文件:NoSwordModule.java   
private static void onCraftItem(Recipe recipe, CraftingInventory inventory)
{
    if (recipe.getResult().getType() == Material.WOOD_SWORD
            || recipe.getResult().getType() == Material.STONE_SWORD
            || recipe.getResult().getType() == Material.IRON_SWORD
            || recipe.getResult().getType() == Material.GOLD_SWORD
            || recipe.getResult().getType() == Material.DIAMOND_SWORD)
        inventory.setResult(new ItemStack(Material.AIR));
}
项目:SurvivalAPI    文件:RapidToolsModule.java   
private void onCraftItem(Recipe recipe, CraftingInventory inventory)
{
    if (recipe.getResult().getType() == Material.WOOD_SWORD)
        inventory.setResult(new ItemStack(this.getMaterial(Material.WOOD_SWORD)));
    else if (recipe.getResult().getType() == Material.WOOD_PICKAXE)
        inventory.setResult(new ItemStack(this.getMaterial(Material.WOOD_PICKAXE)));
    else if (recipe.getResult().getType() == Material.WOOD_AXE)
        inventory.setResult(new ItemStack(this.getMaterial(Material.WOOD_AXE)));
    else if (recipe.getResult().getType() == Material.WOOD_SPADE)
        inventory.setResult(new ItemStack(this.getMaterial(Material.WOOD_SPADE)));
}
项目:HCFCore    文件:EnderChestRemovalListener.java   
/**
 * Removes the ender-chest crafting recipe from the server meaning it can only be obtained from creative mode.
 */
private void removeRecipe() {
    for (Iterator<Recipe> iterator = Bukkit.recipeIterator(); iterator.hasNext();) {
        if (iterator.next().getResult().getType() == Material.ENDER_CHEST) {
            iterator.remove();
        }
    }
}
项目:HCFCore    文件:EnderChestRemovalListener.java   
/**
 * Removes the ender-chest crafting recipe from the server meaning it can only be obtained from creative mode.
 */
private void removeRecipe() {
    for (Iterator<Recipe> iterator = Bukkit.recipeIterator(); iterator.hasNext();) {
        if (iterator.next().getResult().getType() == Material.ENDER_CHEST) {
            iterator.remove();
        }
    }
}
项目:FlexMC    文件:FlexWorkbenchInventory.java   
@Override
protected void setRawSlot( short slot, ItemStack itemStack ) {
    this.setItem( slot, itemStack );
    if( slot > 0 ) {
        me.lukas81298.flexmc.inventory.crafting.Recipe recipe = Flex.getServer().getRecipeManager().getRecipe( this );
        if( recipe != null ) {
            setItem( 0, recipe.getResult() );
        }
    }
}
项目:ThermosRebased    文件:CraftInventoryCrafting.java   
public Recipe getRecipe() {
    net.minecraft.item.crafting.IRecipe recipe = ((net.minecraft.inventory.InventoryCrafting)getInventory()).currentRecipe;
    // Cauldron start - handle custom recipe classes without Bukkit API equivalents
    try {
        return recipe == null ? null : recipe.toBukkitRecipe();
    } catch (AbstractMethodError ex) {
        // No Bukkit wrapper provided
        return new CustomModRecipe(recipe);
    }
    // Cauldron end
}
项目:CS-CoreLib    文件:RecipeManager.java   
public static void removeRecipe(Material type) {
    Iterator<Recipe> recipes = Bukkit.recipeIterator();
    Recipe recipe;
    while (recipes.hasNext()) {
        recipe = recipes.next();
        if (recipe != null && recipe.getResult().getType() == type) {
            recipes.remove();
        }
    }
}