summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/inventory/FurnaceRecipe.java23
-rw-r--r--src/main/java/org/bukkit/inventory/ShapedRecipe.java23
-rw-r--r--src/main/java/org/bukkit/inventory/ShapelessRecipe.java24
3 files changed, 70 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
index 93696606..75ad4be8 100644
--- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
+++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
@@ -15,6 +15,7 @@ public class FurnaceRecipe implements Recipe, Keyed {
private ItemStack ingredient;
private float experience;
private int cookingTime;
+ private String group = "";
@Deprecated
public FurnaceRecipe(ItemStack result, Material source) {
@@ -152,4 +153,26 @@ public class FurnaceRecipe implements Recipe, Keyed {
public NamespacedKey getKey() {
return key;
}
+
+ /**
+ * Get the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @return recipe group. An empty string denotes no group. May not be null.
+ */
+ public String getGroup() {
+ return group;
+ }
+
+ /**
+ * Set the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @param group recipe group. An empty string denotes no group. May not be
+ * null.
+ */
+ public void setGroup(String group) {
+ Preconditions.checkArgument(group != null, "group");
+ this.group = group;
+ }
}
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
index d9af7155..398ac245 100644
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
@@ -19,6 +19,7 @@ public class ShapedRecipe implements Recipe, Keyed {
private final ItemStack output;
private String[] rows;
private Map<Character, ItemStack> ingredients = new HashMap<Character, ItemStack>();
+ private String group = "";
@Deprecated
public ShapedRecipe(ItemStack result) {
@@ -168,4 +169,26 @@ public class ShapedRecipe implements Recipe, Keyed {
public NamespacedKey getKey() {
return key;
}
+
+ /**
+ * Get the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @return recipe group. An empty string denotes no group. May not be null.
+ */
+ public String getGroup() {
+ return group;
+ }
+
+ /**
+ * Set the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @param group recipe group. An empty string denotes no group. May not be
+ * null.
+ */
+ public void setGroup(String group) {
+ Preconditions.checkArgument(group != null, "group");
+ this.group = group;
+ }
}
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
index ca5c09b8..0c340c84 100644
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
@@ -1,5 +1,6 @@
package org.bukkit.inventory;
+import com.google.common.base.Preconditions;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -19,6 +20,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
private final NamespacedKey key;
private final ItemStack output;
private final List<ItemStack> ingredients = new ArrayList<ItemStack>();
+ private String group = "";
@Deprecated
public ShapelessRecipe(ItemStack result) {
@@ -239,4 +241,26 @@ public class ShapelessRecipe implements Recipe, Keyed {
public NamespacedKey getKey() {
return key;
}
+
+ /**
+ * Get the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @return recipe group. An empty string denotes no group. May not be null.
+ */
+ public String getGroup() {
+ return group;
+ }
+
+ /**
+ * Set the group of this recipe. Recipes with the same group may be grouped
+ * together when displayed in the client.
+ *
+ * @param group recipe group. An empty string denotes no group. May not be
+ * null.
+ */
+ public void setGroup(String group) {
+ Preconditions.checkArgument(group != null, "group");
+ this.group = group;
+ }
}