@@ -1,19 +1,24 @@
|
||||
--- a/net/minecraft/server/ShapelessRecipes.java
|
||||
+++ b/net/minecraft/server/ShapelessRecipes.java
|
||||
@@ -5,6 +5,11 @@
|
||||
@@ -5,11 +5,16 @@
|
||||
import com.google.gson.JsonObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class ShapelessRecipes implements IRecipe {
|
||||
|
||||
public class ShapelessRecipes extends IRecipe {
|
||||
|
||||
private final ItemStack result;
|
||||
@@ -15,6 +20,20 @@
|
||||
this.ingredients = list;
|
||||
private final NonNullList<RecipeItemStack> ingredients;
|
||||
+ public MinecraftKey key; // CraftBukkit
|
||||
|
||||
public ShapelessRecipes(String s, ItemStack itemstack, NonNullList<RecipeItemStack> nonnulllist) {
|
||||
super(s);
|
||||
@@ -17,6 +22,21 @@
|
||||
this.ingredients = nonnulllist;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -21,8 +26,9 @@
|
||||
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
|
||||
+ for (ItemStack stack : (List<ItemStack>) this.ingredients) {
|
||||
+ if (stack != null) {
|
||||
+ for (RecipeItemStack list : this.ingredients) {
|
||||
+ if (list != null) {
|
||||
+ net.minecraft.server.ItemStack stack = list.choices[0];
|
||||
+ recipe.addIngredient(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), stack.getData());
|
||||
+ }
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user