Class CraftingRecipe
java.lang.Object
org.bukkit.inventory.CraftingRecipe
- Direct Known Subclasses:
ShapedRecipe, ShapelessRecipe, TransmuteRecipe
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCraftingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) -
Method Summary
Modifier and TypeMethodDescriptionprotected static @NotNull ItemStackcheckResult(@NotNull ItemStack result) Checks an ItemStack to be used in constructors related to CraftingRecipe is not empty.@NotNull CraftingBookCategoryGets the category which this recipe will appear in the recipe book under.@NotNull StringgetGroup()Get the group of this recipe.@NotNull NamespacedKeygetKey()Return the namespaced identifier for this object.@NotNull ItemStackGet the result of this recipe.voidsetCategory(@NotNull CraftingBookCategory category) Sets the category which this recipe will appear in the recipe book under.voidSet the group of this recipe.
-
Constructor Details
-
CraftingRecipe
-
-
Method Details
-
getKey
Description copied from interface:KeyedReturn the namespaced identifier for this object. -
getResult
-
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.
- Since:
- 1.20.1
-
setGroup
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.- Since:
- 1.20.1
-
getCategory
Gets the category which this recipe will appear in the recipe book under.
Defaults toCraftingBookCategory.MISCif not set.- Returns:
- recipe book category
- Since:
- 1.20.1
-
setCategory
Sets the category which this recipe will appear in the recipe book under.
Defaults toCraftingBookCategory.MISCif not set.- Parameters:
category- recipe book category- Since:
- 1.20.1
-
checkResult
@Internal @NotNull protected static @NotNull ItemStack checkResult(@NotNull @NotNull ItemStack result) Checks an ItemStack to be used in constructors related to CraftingRecipe is not empty.- Parameters:
result- an ItemStack- Returns:
- the same result ItemStack
- Throws:
IllegalArgumentException- if theresultis an empty item (AIR)
-