summaryrefslogtreecommitdiff
path: root/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-01-29 18:28:37 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-01-29 18:28:37 +0000
commit73ca377dc01f859dabd7b07738cb7aeb762272b1 (patch)
tree9c0acccbfbf78e813fb838ab566c96a40c5f36bb /java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
parent06f62473f0622efe6decc32b70516a7c5d3d3572 (diff)
Made lots of changes
Diffstat (limited to 'java/darkknight/jewelrycraft/container/ContainerJewelryTab.java')
-rw-r--r--java/darkknight/jewelrycraft/container/ContainerJewelryTab.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java b/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
new file mode 100644
index 0000000..e33976a
--- /dev/null
+++ b/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
@@ -0,0 +1,65 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class ContainerJewelryTab extends Container
+{
+ public ContainerJewelryTab(EntityPlayer player, InventoryPlayer inv)
+ {
+ int x, y;
+ // Rings
+ for (x = 0; x <= 9; x++)
+ this.addSlotToContainer(new SlotRing(new JewelryInventory(), x, 8 + x * 18, 7));
+
+ // Hotbar
+ for (x = 0; x < 9; ++x)
+ this.addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
+
+ // Inventory
+ for (x = 0; x < 3; ++x)
+ for (y = 0; y < 9; ++y)
+ this.addSlotToContainer(new Slot(inv, 9 + y + x * 9, 17 + y * 18, 84 + x * 18));
+
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
+ {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) this.inventorySlots.get(par2);
+
+// if (slot != null && slot.getHasStack())
+// {
+// ItemStack itemstack1 = slot.getStack();
+// itemstack = itemstack1.copy();
+//
+// if (par2 < 27)
+// {
+// if (!this.mergeItemStack(itemstack1, 27, this.inventorySlots.size(), true)) { return null; }
+// }
+// else if (!this.mergeItemStack(itemstack1, 0, 27, false)) { return null; }
+//
+// if (itemstack1.stackSize == 0)
+// {
+// slot.putStack((ItemStack) null);
+// }
+// else
+// {
+// slot.onSlotChanged();
+// }
+// }
+//
+ return itemstack;
+ }
+}