public class DynamicRecipe extends Object implements org.bukkit.inventory.Recipe
Represents a dynamic recipe. These are recipes that have can have different results, depending on the inputs used, rather than a simple matching algorithm.
Used for recipes such as banners, which require item metadata to be copied to an item, along with having a semi-shaped recipe.
| Constructor and Description |
|---|
DynamicRecipe() |
DynamicRecipe(ItemMatcher matcher) |
| Modifier and Type | Method and Description |
|---|---|
org.bukkit.inventory.ItemStack |
getResult()
Gets the result of this recipe, given the input of
matches(ItemStack[]). |
boolean |
matches(org.bukkit.inventory.ItemStack[] matrix)
Checks to see if the recipe will match a crafting matrix.
|
void |
setMatcher(ItemMatcher matcher)
Sets the
ItemMatcher to be used with this recipe. |
public DynamicRecipe()
public DynamicRecipe(ItemMatcher matcher)
public void setMatcher(ItemMatcher matcher)
ItemMatcher to be used with this recipe.matcher - ItemMatcher to use. Must not be null.public boolean matches(org.bukkit.inventory.ItemStack[] matrix)
getResult() to return the correct item (including all metadata) for the input.matrix - Items on the crafting gridpublic org.bukkit.inventory.ItemStack getResult()
matches(ItemStack[]).getResult in interface org.bukkit.inventory.RecipeCopyright © 2021. All rights reserved.