Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.inventory.ShapedRecipe Class Reference

Represents a shaped (ie normal) crafting recipe. More...

+ Inheritance diagram for org.bukkit.inventory.ShapedRecipe:
+ Collaboration diagram for org.bukkit.inventory.ShapedRecipe:

Public Member Functions

 ShapedRecipe (ItemStack result)
 Create a shaped recipe to craft the specified ItemStack.
 
ShapedRecipe shape (final String...shape)
 Set the shape of this recipe to the specified rows.
 
ShapedRecipe setIngredient (char key, MaterialData ingredient)
 Sets the material that a character in the recipe shape refers to.
 
ShapedRecipe setIngredient (char key, Material ingredient)
 Sets the material that a character in the recipe shape refers to.
 
ShapedRecipe setIngredient (char key, Material ingredient, int raw)
 Sets the material that a character in the recipe shape refers to.
 
Map< Character, ItemStackgetIngredientMap ()
 Get a copy of the ingredients map.
 
String[] getShape ()
 Get the shape.
 
ItemStack getResult ()
 Get the result.
 
- Public Member Functions inherited from org.bukkit.inventory.Recipe
ItemStack getResult ()
 Get the result of this recipe.
 

Detailed Description

Represents a shaped (ie normal) crafting recipe.

Definition at line 14 of file ShapedRecipe.java.

Constructor & Destructor Documentation

org.bukkit.inventory.ShapedRecipe.ShapedRecipe ( ItemStack  result)

Create a shaped 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
resultThe item you want the recipe to create.
See Also
ShapedRecipe::shape(String...)
ShapedRecipe::setIngredient(char, Material)
ShapedRecipe::setIngredient(char, Material, int)
ShapedRecipe::setIngredient(char, MaterialData)

Definition at line 29 of file ShapedRecipe.java.

Member Function Documentation

Map<Character, ItemStack> org.bukkit.inventory.ShapedRecipe.getIngredientMap ( )

Get a copy of the ingredients map.

Returns
The mapping of character to ingredients.

Definition at line 108 of file ShapedRecipe.java.

ItemStack org.bukkit.inventory.ShapedRecipe.getResult ( )

Get the result.

Returns
The result stack.

Definition at line 134 of file ShapedRecipe.java.

References org.bukkit.inventory.ItemStack.clone().

String [] org.bukkit.inventory.ShapedRecipe.getShape ( )

Get the shape.

Returns
The recipe's shape.

Definition at line 125 of file ShapedRecipe.java.

ShapedRecipe org.bukkit.inventory.ShapedRecipe.setIngredient ( char  key,
MaterialData  ingredient 
)

Sets the material that a character in the recipe shape refers to.

Parameters
keyThe character that represents the ingredient in the shape.
ingredientThe ingredient.
Returns
The changed recipe, so you can chain calls.

Definition at line 74 of file ShapedRecipe.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.getItemType().

Referenced by org.bukkit.inventory.ShapedRecipe.setIngredient().

ShapedRecipe org.bukkit.inventory.ShapedRecipe.setIngredient ( char  key,
Material  ingredient 
)

Sets the material that a character in the recipe shape refers to.

Parameters
keyThe character that represents the ingredient in the shape.
ingredientThe ingredient.
Returns
The changed recipe, so you can chain calls.

Definition at line 85 of file ShapedRecipe.java.

References org.bukkit.inventory.ShapedRecipe.setIngredient().

ShapedRecipe org.bukkit.inventory.ShapedRecipe.setIngredient ( char  key,
Material  ingredient,
int  raw 
)

Sets the material that a character in the recipe shape refers to.

Parameters
keyThe character that represents the ingredient in the shape.
ingredientThe ingredient.
rawThe raw material data as an integer.
Returns
The changed recipe, so you can chain calls.

Definition at line 97 of file ShapedRecipe.java.

ShapedRecipe org.bukkit.inventory.ShapedRecipe.shape ( final String...  shape)

Set the shape of this recipe to the specified rows.

Each character represents a different ingredient; exactly what each character represents is set separately. The first row supplied corresponds with the upper most part of the recipe on the workbench e.g. if all three rows are supplies the first string represents the top row on the workbench.

Parameters
shapeThe rows of the recipe (up to 3 rows).
Returns
The changed recipe, so you can chain calls.

Definition at line 42 of file ShapedRecipe.java.


The documentation for this class was generated from the following file: