summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/inventory/FurnaceRecipe.java50
1 files changed, 48 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
index 80753238..b1774d6d 100644
--- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
+++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
@@ -9,6 +9,7 @@ import org.bukkit.material.MaterialData;
public class FurnaceRecipe implements Recipe {
private ItemStack output;
private ItemStack ingredient;
+ private float experience;
/**
* Create a furnace recipe to craft the specified ItemStack.
@@ -17,7 +18,7 @@ public class FurnaceRecipe implements Recipe {
* @param source The input material.
*/
public FurnaceRecipe(ItemStack result, Material source) {
- this(result, source, 0);
+ this(result, source, 0, 0);
}
/**
@@ -27,7 +28,18 @@ public class FurnaceRecipe implements Recipe {
* @param source The input material.
*/
public FurnaceRecipe(ItemStack result, MaterialData source) {
- this(result, source.getItemType(), source.getData());
+ this(result, source.getItemType(), source.getData(), 0);
+ }
+
+ /**
+ * Create a furnace recipe to craft the specified ItemStack.
+ *
+ * @param result The item you want the recipe to create.
+ * @param source The input material.
+ * @param experience The experience given by this recipe
+ */
+ public FurnaceRecipe(ItemStack result, MaterialData source, float experience) {
+ this(result, source.getItemType(), source.getData(), experience);
}
/**
@@ -41,8 +53,24 @@ public class FurnaceRecipe implements Recipe {
*/
@Deprecated
public FurnaceRecipe(ItemStack result, Material source, int data) {
+ this(result, source, data, 0);
+ }
+
+ /**
+ * Create a furnace recipe to craft the specified ItemStack.
+ *
+ * @param result The item you want the recipe to create.
+ * @param source The input material.
+ * @param data The data value. (Note: This is currently ignored by the
+ * CraftBukkit server.)
+ * @param experience The experience given by this recipe
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public FurnaceRecipe(ItemStack result, Material source, int data, float experience) {
this.output = new ItemStack(result);
this.ingredient = new ItemStack(source, 1, (short) data);
+ this.experience = experience;
}
/**
@@ -97,4 +125,22 @@ public class FurnaceRecipe implements Recipe {
public ItemStack getResult() {
return output.clone();
}
+
+ /**
+ * Sets the experience given by this recipe.
+ *
+ * @param experience the experience level
+ */
+ public void setExperience(float experience) {
+ this.experience = experience;
+ }
+
+ /**
+ * Get the experience given by this recipe.
+ *
+ * @return experience level
+ */
+ public float getExperience() {
+ return experience;
+ }
}