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 Summary
Constructors Constructor Description CookingRecipe(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime)
Create a cooking recipe to craft the specified ItemStack.CookingRecipe(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime)
Create a cooking recipe to craft the specified ItemStack.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCookingTime()
Get the cooking time for this recipe in ticks.float
getExperience()
Get the experience given by this recipe.String
getGroup()
Get the group of this recipe.ItemStack
getInput()
Get the input material.RecipeChoice
getInputChoice()
Get the input choice.NamespacedKey
getKey()
Return the namespaced identifier for this object.ItemStack
getResult()
Get the result of this recipe.void
setCookingTime(int cookingTime)
Set the cooking time for this recipe in ticks.void
setExperience(float experience)
Sets the experience given by this recipe.void
setGroup(String group)
Set the group of this recipe.CookingRecipe
setInput(Material input)
Sets the input of this cooking recipe.T
setInputChoice(RecipeChoice input)
Sets the input of this cooking recipe.
-
-
-
Constructor Detail
-
CookingRecipe
public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime)
Create a cooking recipe to craft the specified ItemStack.- Parameters:
key
- The unique recipe keyresult
- The item you want the recipe to create.source
- The input material.experience
- The experience given by this recipecookingTime
- The cooking time (in ticks)
-
CookingRecipe
public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime)
Create a cooking recipe to craft the specified ItemStack.- Parameters:
key
- The unique recipe keyresult
- The item you want the recipe to create.input
- The input choices.experience
- The experience given by this recipecookingTime
- The cooking time (in ticks)
-
-
Method Detail
-
setInput
@NotNull public CookingRecipe setInput(@NotNull Material input)
Sets the input of this cooking recipe.- Parameters:
input
- The input material.- Returns:
- The changed recipe, so you can chain calls.
-
getInput
@NotNull public ItemStack getInput()
Get the input material.- Returns:
- The input material.
-
setInputChoice
@NotNull public T setInputChoice(@NotNull RecipeChoice input)
Sets the input of this cooking recipe.- Parameters:
input
- The input choice.- Returns:
- The changed recipe, so you can chain calls.
-
getInputChoice
@NotNull public RecipeChoice getInputChoice()
Get the input choice.- Returns:
- The input choice.
-
getResult
@NotNull public ItemStack getResult()
Get the result of this recipe.
-
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
@NotNull public NamespacedKey getKey()
Description copied from interface:Keyed
Return the namespaced identifier for this object.
-
getGroup
@NotNull 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(@NotNull 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.
-
-