Package org.bukkit.inventory
Interface RecipeChoice
- All Known Subinterfaces:
RecipeChoice.ItemTypeChoice
- All Known Implementing Classes:
RecipeChoice.ExactChoice,RecipeChoice.MaterialChoice
Represents a potential item match within a recipe. All choices within a
recipe must be satisfied for it to be craftable. Choices must never be
null or air.
This class is not legal for implementation by plugins!
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classRepresents a choice that will be valid only if one of the stacks is exactly matched (aside from stack size).static interfaceRepresents a choice that will be valid if theItemStack.getType()matches any of the item types in the set.static classRepresents a choice of multiple matching Materials. -
Method Summary
Modifier and TypeMethodDescriptionclone()static RecipeChoiceempty()An "empty" recipe choice.Deprecated.for compatibility onlystatic RecipeChoice.ItemTypeChoiceitemType(RegistryKeySet<ItemType> itemTypes) Creates a new recipe choice based on aRegistryKeySetof item types.static RecipeChoice.ItemTypeChoiceCreates a new recipe choice based on a collection ofItemTypes.booleandefault RecipeChoicevalidate(boolean allowEmptyRecipes)
-
Method Details
-
empty
An "empty" recipe choice. Only valid as a recipe choice in specific places. Check the javadocs of a method before using it to be sure it's valid for that recipe and ingredient type.- Returns:
- the empty recipe choice
-
itemType
@Contract(pure=true, value="_, _ -> new") static RecipeChoice.ItemTypeChoice itemType(ItemType itemType, ItemType... itemTypes) Creates a new recipe choice based on a collection ofItemTypes.- Parameters:
itemType- the first item type to matchitemTypes- other item types to match.- Returns:
- a new recipe choice
-
itemType
@Contract(pure=true, value="_ -> new") static RecipeChoice.ItemTypeChoice itemType(RegistryKeySet<ItemType> itemTypes) Creates a new recipe choice based on aRegistryKeySetof item types. Can either be created viaRegistrySet.keySet(RegistryKey, TypedKey[])or obtained fromRegistry.getTag(TagKey).- Parameters:
itemTypes- the item types to match- Returns:
- a new recipe choice
-
getItemStack
Deprecated.for compatibility onlyGets a single item stack representative of this stack choice.- Returns:
- a single representative item
-
clone
RecipeChoice clone() -
test
-
validate
-