Java Code Examples for org.bukkit.Bukkit.recipeIterator()

The following are Jave code examples for showing how to use recipeIterator() of the org.bukkit.Bukkit class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Slimefun4-Chinese-Version   File: ElectricFurnace.java   View Source Code Vote up 5 votes
public void registerDefaultRecipes()
{
    for(Iterator iterator = Bukkit.recipeIterator(); iterator.hasNext();)
    {
        Recipe r = (Recipe)iterator.next();
        if(r instanceof FurnaceRecipe)
            registerRecipe(4, new ItemStack[] {
                ((FurnaceRecipe)r).getInput()
            }, new ItemStack[] {
                r.getResult()
            });
    }

}
 
Example 2
Project: HCFCore   File: EnderChestRemovalListener.java   View Source Code Vote up 5 votes
/**
 * 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();
        }
    }
}
 
Example 3
Project: HCFCore   File: EnderChestRemovalListener.java   View Source Code Vote up 5 votes
/**
 * 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();
        }
    }
}