Package org.bukkit.inventory
Class CookingRecipe<T extends CookingRecipe>
java.lang.Object
org.bukkit.inventory.CookingRecipe<T>
- Type Parameters:
- T- type of recipe
- Direct Known Subclasses:
- BlastingRecipe,- CampfireRecipe,- FurnaceRecipe,- SmokingRecipe
public abstract class CookingRecipe<T extends CookingRecipe>
extends Object
implements Recipe, Keyed
Represents a cooking recipe.
- 
Constructor SummaryConstructorsConstructorDescriptionCookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.
- 
Method SummaryModifier and TypeMethodDescriptionGets the category which this recipe will appear in the recipe book under.intGet the cooking time for this recipe in ticks.floatGet the experience given by this recipe.getGroup()Get the group of this recipe.getInput()Deprecated.Get the input choice.getKey()Return the namespaced identifier for this object.Get the result of this recipe.voidsetCategory(@NotNull CookingBookCategory category) Sets the category which this recipe will appear in the recipe book under.voidsetCookingTime(int cookingTime) Set the cooking time for this recipe in ticks.voidsetExperience(float experience) Sets the experience given by this recipe.voidSet the group of this recipe.Sets the input of this cooking recipe.setInputChoice(@NotNull RecipeChoice input) Sets the input of this cooking recipe.
- 
Constructor Details- 
CookingRecipepublic CookingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @NotNull @NotNull Material source, float experience, int cookingTime) Create a cooking 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)
 
- 
CookingRecipepublic CookingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @NotNull @NotNull RecipeChoice input, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.- Parameters:
- key- The unique recipe key
- result- The item you want the recipe to create.
- input- The input choices.
- experience- The experience given by this recipe
- cookingTime- The cooking time (in ticks)
 
 
- 
- 
Method Details- 
setInputSets the input of this cooking recipe.- Parameters:
- input- The input material.
- Returns:
- The changed recipe, so you can chain calls.
 
- 
getInputDeprecated.UsegetInputChoice()instead for more complete data.Get the input material.- Returns:
- The input material.
 
- 
setInputChoiceSets the input of this cooking recipe.- Parameters:
- input- The input choice.
- Returns:
- The changed recipe, so you can chain calls.
 
- 
getInputChoiceGet the input choice.- Returns:
- The input choice.
 
- 
getResultGet the result of this recipe.
- 
setExperiencepublic void setExperience(float experience) Sets the experience given by this recipe.- Parameters:
- experience- the experience level
 
- 
getExperiencepublic float getExperience()Get the experience given by this recipe.- Returns:
- experience level
 
- 
setCookingTimepublic void setCookingTime(int cookingTime) Set the cooking time for this recipe in ticks.- Parameters:
- cookingTime- new cooking time
 
- 
getCookingTimepublic int getCookingTime()Get the cooking time for this recipe in ticks.- Returns:
- cooking time
 
- 
getKeyDescription copied from interface:KeyedReturn the namespaced identifier for this object.
- 
getGroupGet 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.
 
- 
setGroupSet 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.
 
- 
getCategoryGets the category which this recipe will appear in the recipe book under. Defaults toCookingBookCategory.MISCif not set.- Returns:
- recipe book category
 
- 
setCategorySets the category which this recipe will appear in the recipe book under. Defaults toCookingBookCategory.MISCif not set.- Parameters:
- category- recipe book category
 
 
- 
getInputChoice()instead for more complete data.