Package org.bukkit.inventory
Class ShapelessRecipe
java.lang.Object
org.bukkit.inventory.CraftingRecipe
org.bukkit.inventory.ShapelessRecipe
Represents a shapeless recipe, where the arrangement of the ingredients on
the crafting grid does not matter.
-
Constructor Summary
ConstructorDescriptionShapelessRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result) Create a shapeless recipe to craft the specified ItemStack.ShapelessRecipe
(@NotNull ItemStack result) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionaddIngredient
(int count, @NotNull Material ingredient) Adds multiples of the specified ingredient.addIngredient
(int count, @NotNull Material ingredient, int rawdata) Deprecated.Magic valueaddIngredient
(int count, @NotNull ItemStack item) addIngredient
(int count, @NotNull MaterialData ingredient) Deprecated.addIngredient
(@NotNull Material ingredient) Adds the specified ingredient.addIngredient
(@NotNull Material ingredient, int rawdata) Deprecated.Magic valueaddIngredient
(@NotNull ItemStack item) addIngredient
(@NotNull RecipeChoice ingredient) addIngredient
(@NotNull MaterialData ingredient) Deprecated.Deprecated.UsegetChoiceList()
instead for more complete data.removeIngredient
(int count, @NotNull Material ingredient) Removes multiple instances of an ingredient from the list.removeIngredient
(int count, @NotNull Material ingredient, int rawdata) Deprecated.Magic valueremoveIngredient
(int count, @NotNull ItemStack item) removeIngredient
(int count, @NotNull MaterialData ingredient) Deprecated.removeIngredient
(@NotNull Material ingredient) Removes an ingredient from the list.removeIngredient
(@NotNull Material ingredient, int rawdata) Deprecated.Magic valueremoveIngredient
(@NotNull RecipeChoice ingredient) Removes an ingredient from the list.removeIngredient
(@NotNull MaterialData ingredient) Deprecated.Methods inherited from class org.bukkit.inventory.CraftingRecipe
checkResult, getCategory, getGroup, getKey, getResult, setCategory, setGroup
-
Constructor Details
-
ShapelessRecipe
Deprecated. -
ShapelessRecipe
Create a shapeless recipe to craft the specified ItemStack. The constructor merely determines the result and type; to set the actual recipe, you'll need to call the appropriate methods.- Parameters:
key
- the unique recipe keyresult
- The item you want the recipe to create.- Throws:
IllegalArgumentException
- if theresult
is an empty item (AIR)- See Also:
-
-
Method Details
-
addIngredient
@NotNull @Deprecated public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull MaterialData ingredient) Deprecated.Adds the specified ingredient.- Parameters:
ingredient
- The ingredient to add.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
Adds the specified ingredient.- Parameters:
ingredient
- The ingredient to add.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
@Deprecated @NotNull public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull Material ingredient, int rawdata) Deprecated.Magic valueAdds the specified ingredient.- Parameters:
ingredient
- The ingredient to add.rawdata
- The data value, or -1 to allow any data value.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
@NotNull @Deprecated public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull MaterialData ingredient) Deprecated.Adds multiples of the specified ingredient.- Parameters:
count
- How many to add (can't be more than 9!)ingredient
- The ingredient to add.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
@NotNull public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull Material ingredient) Adds multiples of the specified ingredient.- Parameters:
count
- How many to add (can't be more than 9!)ingredient
- The ingredient to add.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
@Deprecated @NotNull public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull Material ingredient, int rawdata) Deprecated.Magic valueAdds multiples of the specified ingredient.- Parameters:
count
- How many to add (can't be more than 9!)ingredient
- The ingredient to add.rawdata
- The data value, or -1 to allow any data value.- Returns:
- The changed recipe, so you can chain calls.
-
addIngredient
-
addIngredient
-
addIngredient
-
removeIngredient
-
removeIngredient
-
removeIngredient
@NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull RecipeChoice ingredient) Removes an ingredient from the list.- Parameters:
ingredient
- The ingredient to remove- Returns:
- The changed recipe.
-
removeIngredient
Removes an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. Only removes exact matches, with a data value of 0.- Parameters:
ingredient
- The ingredient to remove- Returns:
- The changed recipe.
-
removeIngredient
@NotNull @Deprecated public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull MaterialData ingredient) Deprecated.Removes an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. If the data value is -1, only ingredients with a -1 data value will be removed.- Parameters:
ingredient
- The ingredient to remove- Returns:
- The changed recipe.
-
removeIngredient
@NotNull public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull Material ingredient) Removes multiple instances of an ingredient from the list. If there are fewer instances than specified, all will be removed. Only removes exact matches, with a data value of 0.- Parameters:
count
- The number of copies to remove.ingredient
- The ingredient to remove- Returns:
- The changed recipe.
-
removeIngredient
@NotNull @Deprecated public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull MaterialData ingredient) Deprecated.Removes multiple instances of an ingredient from the list. If there are less instances then specified, all will be removed. If the data value is -1, only ingredients with a -1 data value will be removed.- Parameters:
count
- The number of copies to remove.ingredient
- The ingredient to remove.- Returns:
- The changed recipe.
-
removeIngredient
@Deprecated @NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull Material ingredient, int rawdata) Deprecated.Magic valueRemoves an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. If the data value is -1, only ingredients with a -1 data value will be removed.- Parameters:
ingredient
- The ingredient to removerawdata
- The data value;- Returns:
- The changed recipe.
-
removeIngredient
@Deprecated @NotNull public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull Material ingredient, int rawdata) Deprecated.Magic valueRemoves multiple instances of an ingredient from the list. If there are less instances then specified, all will be removed. If the data value is -1, only ingredients with a -1 data value will be removed.- Parameters:
count
- The number of copies to remove.ingredient
- The ingredient to remove.rawdata
- The data value.- Returns:
- The changed recipe.
-
getIngredientList
Deprecated.UsegetChoiceList()
instead for more complete data.Get the list of ingredients used for this recipe.- Returns:
- The input list
-
getChoiceList
-