org.bukkit.inventory
Class ShapelessRecipe

java.lang.Object
  extended by org.bukkit.inventory.ShapelessRecipe
All Implemented Interfaces:
Recipe

public class ShapelessRecipe
extends Object
implements Recipe

Represents a shapeless recipe, where the arrangement of the ingredients on the crafting grid does not matter.


Constructor Summary
ShapelessRecipe(ItemStack result)
          Create a shapeless recipe to craft the specified ItemStack.
 
Method Summary
 ShapelessRecipe addIngredient(int count, Material ingredient)
          Adds multiples of the specified ingredient.
 ShapelessRecipe addIngredient(int count, MaterialData ingredient)
          Adds multiples of the specified ingredient.
 ShapelessRecipe addIngredient(int count, Material ingredient, int rawdata)
          Deprecated. Magic value
 ShapelessRecipe addIngredient(Material ingredient)
          Adds the specified ingredient.
 ShapelessRecipe addIngredient(MaterialData ingredient)
          Adds the specified ingredient.
 ShapelessRecipe addIngredient(Material ingredient, int rawdata)
          Deprecated. Magic value
 List<ItemStack> getIngredientList()
          Get the list of ingredients used for this recipe.
 ItemStack getResult()
          Get the result of this recipe.
 ShapelessRecipe removeIngredient(int count, Material ingredient)
          Removes multiple instances of an ingredient from the list.
 ShapelessRecipe removeIngredient(int count, MaterialData ingredient)
          Removes multiple instances of an ingredient from the list.
 ShapelessRecipe removeIngredient(int count, Material ingredient, int rawdata)
          Deprecated. Magic value
 ShapelessRecipe removeIngredient(Material ingredient)
          Removes an ingredient from the list.
 ShapelessRecipe removeIngredient(MaterialData ingredient)
          Removes an ingredient from the list.
 ShapelessRecipe removeIngredient(Material ingredient, int rawdata)
          Deprecated. Magic value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapelessRecipe

public ShapelessRecipe(ItemStack result)
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:
result - The item you want the recipe to create.
See Also:
addIngredient(Material), addIngredient(MaterialData), addIngredient(Material,int), addIngredient(int,Material), addIngredient(int,MaterialData), addIngredient(int,Material,int)
Method Detail

addIngredient

public ShapelessRecipe addIngredient(MaterialData ingredient)
Adds the specified ingredient.

Parameters:
ingredient - The ingredient to add.
Returns:
The changed recipe, so you can chain calls.

addIngredient

public ShapelessRecipe addIngredient(Material ingredient)
Adds the specified ingredient.

Parameters:
ingredient - The ingredient to add.
Returns:
The changed recipe, so you can chain calls.

addIngredient

@Deprecated
public ShapelessRecipe addIngredient(Material ingredient,
                                                int rawdata)
Deprecated. Magic value

Adds 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

public ShapelessRecipe addIngredient(int count,
                                     MaterialData 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

public ShapelessRecipe addIngredient(int count,
                                     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
public ShapelessRecipe addIngredient(int count,
                                                Material ingredient,
                                                int rawdata)
Deprecated. Magic value

Adds 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.

removeIngredient

public ShapelessRecipe removeIngredient(Material ingredient)
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

public ShapelessRecipe removeIngredient(MaterialData ingredient)
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

public ShapelessRecipe removeIngredient(int count,
                                        Material ingredient)
Removes multiple instances of an ingredient from the list. If there are less instances then 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

public ShapelessRecipe removeIngredient(int count,
                                        MaterialData ingredient)
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
public ShapelessRecipe removeIngredient(Material ingredient,
                                                   int rawdata)
Deprecated. Magic value

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
rawdata - The data value;
Returns:
The changed recipe.

removeIngredient

@Deprecated
public ShapelessRecipe removeIngredient(int count,
                                                   Material ingredient,
                                                   int rawdata)
Deprecated. Magic value

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.
rawdata - The data value.
Returns:
The changed recipe.

getResult

public ItemStack getResult()
Get the result of this recipe.

Specified by:
getResult in interface Recipe
Returns:
The result stack.

getIngredientList

public List<ItemStack> getIngredientList()
Get the list of ingredients used for this recipe.

Returns:
The input list


Copyright © 2013. All Rights Reserved.