summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/InventoryCrafting.java
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-01-09 18:27:46 +0100
committerErik Broes <erikbroes@grum.nl>2011-01-09 18:28:46 +0100
commite8a565e6cfd2bc326a1207e17165916f7a830497 (patch)
tree561bfaf2b3e83ed0c43b632816de64cf5f5415fb /src/main/java/net/minecraft/server/InventoryCrafting.java
parentb72dad0a61d11c01c498a7e58b3e4a7389533488 (diff)
downloadcraftbukkit-e8a565e6cfd2bc326a1207e17165916f7a830497.tar
craftbukkit-e8a565e6cfd2bc326a1207e17165916f7a830497.tar.gz
craftbukkit-e8a565e6cfd2bc326a1207e17165916f7a830497.tar.lz
craftbukkit-e8a565e6cfd2bc326a1207e17165916f7a830497.tar.xz
craftbukkit-e8a565e6cfd2bc326a1207e17165916f7a830497.zip
Added getContents() to IInventory and implemented it.
Implemented Inventory and PlayerInventory and updated StorageMinecart and Slot. Added getMaxStackSize to CraftItemStack.
Diffstat (limited to 'src/main/java/net/minecraft/server/InventoryCrafting.java')
-rw-r--r--src/main/java/net/minecraft/server/InventoryCrafting.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java
new file mode 100644
index 00000000..90502d47
--- /dev/null
+++ b/src/main/java/net/minecraft/server/InventoryCrafting.java
@@ -0,0 +1,69 @@
+package net.minecraft.server;
+
+
+public class InventoryCrafting
+ implements IInventory {
+
+ private ItemStack a[];
+ private int b;
+ private CraftingInventoryCB c;
+
+ //CraftBukkit
+ public ItemStack[] getContents() {
+ return a;
+ }
+
+ public InventoryCrafting(CraftingInventoryCB craftinginventorycb, int i, int j) {
+ b = i * j;
+ a = new ItemStack[b];
+ c = craftinginventorycb;
+ }
+
+ public int a() {
+ return b;
+ }
+
+ public ItemStack a(int i) {
+ return a[i];
+ }
+
+ public String b() {
+ return "Crafting";
+ }
+
+ public ItemStack a(int i, int j) {
+ if (a[i] != null) {
+ if (a[i].a <= j) {
+ ItemStack itemstack = a[i];
+
+ a[i] = null;
+ c.a(this);
+ return itemstack;
+ }
+ ItemStack itemstack1 = a[i].a(j);
+
+ if (a[i].a == 0) {
+ a[i] = null;
+ }
+ c.a(this);
+ return itemstack1;
+ } else {
+ return null;
+ }
+ }
+
+ public void a(int i, ItemStack itemstack) {
+ a[i] = itemstack;
+ c.a(this);
+ }
+
+ public int c() {
+ return 64;
+ }
+
+ public void d() {}
+
+ public boolean a_(EntityPlayer entityplayer) {
+ return true;
+ }
+}