Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
FurnaceRecipe.java
1 package org.bukkit.inventory;
2 
3 import org.bukkit.Material;
5 
6 /**
7  * Represents a smelting recipe.
8  */
9 public class FurnaceRecipe implements Recipe {
10  private ItemStack output;
11  private ItemStack ingredient;
12 
13  /**
14  * Create a furnace recipe to craft the specified ItemStack.
15  *
16  * @param result The item you want the recipe to create.
17  * @param source The input material.
18  */
19  public FurnaceRecipe(ItemStack result, Material source) {
20  this(result, source, 0);
21  }
22 
23  /**
24  * Create a furnace recipe to craft the specified ItemStack.
25  *
26  * @param result The item you want the recipe to create.
27  * @param source The input material.
28  */
29  public FurnaceRecipe(ItemStack result, MaterialData source) {
30  this(result, source.getItemType(), source.getData());
31  }
32 
33  /**
34  * Create a furnace recipe to craft the specified ItemStack.
35  *
36  * @param result The item you want the recipe to create.
37  * @param source The input material.
38  * @param data The data value. (Note: This is currently ignored by the
39  * CraftBukkit server.)
40  * @deprecated Magic value
41  */
42  @Deprecated
43  public FurnaceRecipe(ItemStack result, Material source, int data) {
44  this.output = new ItemStack(result);
45  this.ingredient = new ItemStack(source, 1, (short) data);
46  }
47 
48  /**
49  * Sets the input of this furnace recipe.
50  *
51  * @param input The input material.
52  * @return The changed recipe, so you can chain calls.
53  */
55  return setInput(input.getItemType(), input.getData());
56  }
57 
58  /**
59  * Sets the input of this furnace recipe.
60  *
61  * @param input The input material.
62  * @return The changed recipe, so you can chain calls.
63  */
65  return setInput(input, 0);
66  }
67 
68  /**
69  * Sets the input of this furnace recipe.
70  *
71  * @param input The input material.
72  * @param data The data value. (Note: This is currently ignored by the
73  * CraftBukkit server.)
74  * @return The changed recipe, so you can chain calls.
75  * @deprecated Magic value
76  */
77  @Deprecated
78  public FurnaceRecipe setInput(Material input, int data) {
79  this.ingredient = new ItemStack(input, 1, (short) data);
80  return this;
81  }
82 
83  /**
84  * Get the input material.
85  *
86  * @return The input material.
87  */
88  public ItemStack getInput() {
89  return this.ingredient.clone();
90  }
91 
92  /**
93  * Get the result of this recipe.
94  *
95  * @return The resulting stack.
96  */
97  public ItemStack getResult() {
98  return output.clone();
99  }
100 }
FurnaceRecipe setInput(Material input)
FurnaceRecipe(ItemStack result, Material source, int data)
FurnaceRecipe(ItemStack result, MaterialData source)
FurnaceRecipe(ItemStack result, Material source)
FurnaceRecipe setInput(Material input, int data)
FurnaceRecipe setInput(MaterialData input)