diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-14 13:31:10 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-14 13:31:10 +0000 |
commit | 2761b598452d992b05a384528b54298ab1166456 (patch) | |
tree | fae206cadbc7acd2607b42ac9dc3d962dcaa795a /src/main/java/net/minecraft/server/InventoryCrafting.java | |
parent | e6e50ddf9b7cb9fe4fb5e8102acf117db2db6f2a (diff) | |
download | craftbukkit-2761b598452d992b05a384528b54298ab1166456.tar craftbukkit-2761b598452d992b05a384528b54298ab1166456.tar.gz craftbukkit-2761b598452d992b05a384528b54298ab1166456.tar.lz craftbukkit-2761b598452d992b05a384528b54298ab1166456.tar.xz craftbukkit-2761b598452d992b05a384528b54298ab1166456.zip |
Update to Minecraft Server 1.2
Diffstat (limited to 'src/main/java/net/minecraft/server/InventoryCrafting.java')
-rw-r--r-- | src/main/java/net/minecraft/server/InventoryCrafting.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java index cf1fd2de..aa49ed42 100644 --- a/src/main/java/net/minecraft/server/InventoryCrafting.java +++ b/src/main/java/net/minecraft/server/InventoryCrafting.java @@ -13,24 +13,40 @@ public class InventoryCrafting implements IInventory { // CraftBukkit end
public InventoryCrafting(CraftingInventoryCB craftinginventorycb, int i, int j) {
- b = i * j;
- a = new ItemStack[b];
+ int k = i * j;
+
+ a = new ItemStack[k];
c = craftinginventorycb;
+ b = i;
}
- public int a() {
- return b;
+ public int h_() {
+ return a.length;
}
public ItemStack a(int i) {
- return a[i];
+ if (i >= h_()) {
+ return null;
+ } else {
+ return a[i];
+ }
+ }
+
+ public ItemStack a(int i, int j) {
+ if (i < 0 || i >= b) {
+ return null;
+ } else {
+ int k = i + j * b;
+
+ return a(k);
+ }
}
public String b() {
return "Crafting";
}
- public ItemStack a(int i, int j) {
+ public ItemStack b(int i, int j) {
if (a[i] != null) {
if (a[i].a <= j) {
ItemStack itemstack = a[i];
|