2013-12-01 03:40:53 +00:00
|
|
|
From cf69c189b9d4f9adeded504065f9f1141338a4f7 Mon Sep 17 00:00:00 2001
|
2013-06-01 06:34:52 +00:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Sat, 1 Jun 2013 16:34:38 +1000
|
|
|
|
Subject: [PATCH] Recipe Deconstruction
|
|
|
|
|
|
|
|
Some non API methods contributed by Asphodan to allow recipe deconstruction.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/IRecipe.java b/src/main/java/net/minecraft/server/IRecipe.java
|
|
|
|
index bb28c12..c0836e4 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/IRecipe.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/IRecipe.java
|
|
|
|
@@ -11,4 +11,6 @@ public interface IRecipe {
|
|
|
|
ItemStack b();
|
|
|
|
|
|
|
|
org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit
|
|
|
|
+
|
|
|
|
+ java.util.List<ItemStack> getIngredients(); // Spigot
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java
|
2013-12-01 03:40:53 +00:00
|
|
|
index cc444db..867dd07 100644
|
2013-06-01 06:34:52 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ShapedRecipes.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ShapedRecipes.java
|
|
|
|
@@ -10,7 +10,7 @@ public class ShapedRecipes implements IRecipe {
|
|
|
|
private int width;
|
|
|
|
private int height;
|
|
|
|
private ItemStack[] items;
|
|
|
|
- private ItemStack result;
|
|
|
|
+ public ItemStack result; // Spigot
|
2013-12-01 03:40:53 +00:00
|
|
|
private boolean e;
|
2013-06-01 06:34:52 +00:00
|
|
|
|
2013-12-01 03:40:53 +00:00
|
|
|
public ShapedRecipes(int i, int j, ItemStack[] aitemstack, ItemStack itemstack) {
|
|
|
|
@@ -156,4 +156,11 @@ public class ShapedRecipes implements IRecipe {
|
|
|
|
this.e = true;
|
2013-06-01 06:34:52 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Spigot start
|
|
|
|
+ public java.util.List<ItemStack> getIngredients()
|
|
|
|
+ {
|
|
|
|
+ return java.util.Arrays.asList( items );
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
2013-12-01 03:40:53 +00:00
|
|
|
index 0fab83c..21181fb 100644
|
2013-06-01 06:34:52 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
|
|
|
@@ -11,7 +11,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
|
|
|
|
|
|
|
public class ShapelessRecipes implements IRecipe {
|
|
|
|
|
|
|
|
- private final ItemStack result;
|
|
|
|
+ public final ItemStack result; // Spigot
|
|
|
|
private final List ingredients;
|
|
|
|
|
|
|
|
public ShapelessRecipes(ItemStack itemstack, List list) {
|
|
|
|
@@ -75,4 +75,11 @@ public class ShapelessRecipes implements IRecipe {
|
|
|
|
public int a() {
|
|
|
|
return this.ingredients.size();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Spigot start
|
|
|
|
+ public java.util.List<ItemStack> getIngredients()
|
|
|
|
+ {
|
|
|
|
+ return java.util.Collections.unmodifiableList( ingredients );
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
}
|
|
|
|
--
|
2013-12-01 03:40:53 +00:00
|
|
|
1.8.3.2
|
2013-06-01 06:34:52 +00:00
|
|
|
|