Class FurnaceRecipe

  • All Implemented Interfaces:
    Recipe, Keyed

    public class FurnaceRecipe
    extends Object
    implements Recipe, Keyed
    Represents a smelting recipe.
    • Constructor Detail

      • FurnaceRecipe

        public FurnaceRecipe​(NamespacedKey key,
                             ItemStack result,
                             Material source,
                             float experience,
                             int cookingTime)
        Create a furnace recipe to craft the specified ItemStack.
        Parameters:
        key - The unique recipe key
        result - The item you want the recipe to create.
        source - The input material.
        experience - The experience given by this recipe
        cookingTime - The cooking time (in ticks)
    • Method Detail

      • setInput

        public FurnaceRecipe setInput​(MaterialData input)
        Sets the input of this furnace recipe.
        Parameters:
        input - The input material.
        Returns:
        The changed recipe, so you can chain calls.
      • setInput

        public FurnaceRecipe setInput​(Material input)
        Sets the input of this furnace recipe.
        Parameters:
        input - The input material.
        Returns:
        The changed recipe, so you can chain calls.
      • setInput

        @Deprecated
        public FurnaceRecipe setInput​(Material input,
                                      int data)
        Deprecated.
        Magic value
        Sets the input of this furnace recipe.
        Parameters:
        input - The input material.
        data - The data value. (Note: This is currently ignored by the CraftBukkit server.)
        Returns:
        The changed recipe, so you can chain calls.
      • getInput

        public ItemStack getInput()
        Get the input material.
        Returns:
        The input material.
      • getResult

        public ItemStack getResult()
        Get the result of this recipe.
        Specified by:
        getResult in interface Recipe
        Returns:
        The resulting stack.
      • setExperience

        public void setExperience​(float experience)
        Sets the experience given by this recipe.
        Parameters:
        experience - the experience level
      • getExperience

        public float getExperience()
        Get the experience given by this recipe.
        Returns:
        experience level
      • setCookingTime

        public void setCookingTime​(int cookingTime)
        Set the cooking time for this recipe in ticks.
        Parameters:
        cookingTime - new cooking time
      • getCookingTime

        public int getCookingTime()
        Get the cooking time for this recipe in ticks.
        Returns:
        cooking time
      • getKey

        public NamespacedKey getKey()
        Description copied from interface: Keyed
        Return the namespaced identifier for this object.
        Specified by:
        getKey in interface Keyed
        Returns:
        this object's key
      • getGroup

        public String getGroup()
        Get the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.
        Returns:
        recipe group. An empty string denotes no group. May not be null.
      • setGroup

        public void setGroup​(String group)
        Set the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.
        Parameters:
        group - recipe group. An empty string denotes no group. May not be null.