OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / src / chemicraft / inventory / InventoryChemicalCraftingNBT.java
diff --git a/src/chemicraft/inventory/InventoryChemicalCraftingNBT.java b/src/chemicraft/inventory/InventoryChemicalCraftingNBT.java
new file mode 100644 (file)
index 0000000..f57eb68
--- /dev/null
@@ -0,0 +1,93 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCraftingNBT implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[3];
+
+       private Container eventHandelr;
+
+       public void setEventHandler(Container par1Container){
+               this.eventHandelr = par1Container;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int par1, int par2)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var3 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var3;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int par1)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var2 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               inventory[var1] = var2;
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCraftingInventory";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               this.eventHandelr.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+
+       }
+
+       @Override
+       public void closeChest() {
+
+       }
+
+}