2015-02-26 10:40:16 +00:00
|
|
|
From 40d1381d320d2c39caa8503827a2ede8eb239739 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +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
|
2014-11-28 01:17:45 +00:00
|
|
|
index d2655a0..e5b116f 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/IRecipe.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/IRecipe.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -13,4 +13,6 @@ public interface IRecipe {
|
|
|
|
ItemStack[] b(InventoryCrafting inventorycrafting);
|
|
|
|
|
2014-07-21 20:46:54 +00:00
|
|
|
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
|
2014-11-28 01:17:45 +00:00
|
|
|
index 407cbfb..6c3de90 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ShapedRecipes.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ShapedRecipes.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -11,7 +11,7 @@ public class ShapedRecipes implements IRecipe {
|
|
|
|
private final int width;
|
|
|
|
private final int height;
|
|
|
|
private final ItemStack[] items;
|
|
|
|
- private final ItemStack result;
|
2014-07-21 20:46:54 +00:00
|
|
|
+ public ItemStack result; // Spigot
|
|
|
|
private boolean e;
|
|
|
|
|
|
|
|
public ShapedRecipes(int i, int j, ItemStack[] aitemstack, ItemStack itemstack) {
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -171,4 +171,11 @@ public class ShapedRecipes implements IRecipe {
|
2014-07-21 20:46:54 +00:00
|
|
|
this.e = true;
|
|
|
|
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
|
2014-11-28 01:17:45 +00:00
|
|
|
index 2d243d1..b6106db 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
public class ShapelessRecipes implements IRecipe {
|
|
|
|
|
|
|
|
- private final ItemStack result;
|
|
|
|
+ public final ItemStack result; // Spigot
|
|
|
|
private final List ingredients;
|
|
|
|
|
|
|
|
public ShapelessRecipes(ItemStack itemstack, List list) {
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -90,4 +90,11 @@ public class ShapelessRecipes implements IRecipe {
|
2014-07-21 20:46:54 +00:00
|
|
|
public int a() {
|
|
|
|
return this.ingredients.size();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Spigot start
|
|
|
|
+ public java.util.List<ItemStack> getIngredients()
|
|
|
|
+ {
|
|
|
|
+ return java.util.Collections.unmodifiableList( ingredients );
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
}
|
|
|
|
--
|
2014-11-28 01:17:45 +00:00
|
|
|
2.1.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|