diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
| commit | 420faddca46e70e3a70def168fb4e452ef193b0d (patch) | |
| tree | 247e334012e4bf9e4fa6d42718bf601ce6bd42d9 /java/darkknight/jewelrycraft/container/ContainerRingChest.java | |
| parent | 3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (diff) | |
Added just a butt ton of stuff, also thanks to pau101 for helping me with the Hand Pedestal animation :)
Diffstat (limited to 'java/darkknight/jewelrycraft/container/ContainerRingChest.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/container/ContainerRingChest.java | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/java/darkknight/jewelrycraft/container/ContainerRingChest.java b/java/darkknight/jewelrycraft/container/ContainerRingChest.java index 91bb346..925ded7 100644 --- a/java/darkknight/jewelrycraft/container/ContainerRingChest.java +++ b/java/darkknight/jewelrycraft/container/ContainerRingChest.java @@ -11,56 +11,53 @@ public class ContainerRingChest extends Container { public TileEntityChest theChest; + /** + * @param inv + * @param chest + */ public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest) { theChest = chest; - int x, y; - - for (x = 0; x < 9; x++) - addSlotToContainer(new SlotRingChest(inv, x, 8 + (18 * x), 142, x == inv.currentItem)); - for (y = 0; y < 3; y++) - for (x = 0; x < 9; x++) - addSlotToContainer(new Slot(inv, x + 9 + (y * 9), 8 + (18 * x), 84 + (y * 18))); - - for (y = 0; y < 3; y++) - for (x = 0; x < 9; x++) - addSlotToContainer(new SlotRingChest(chest, 26 - (x + (y * 9)), 8 + (18 * (8 - x)), 17 + ((2 - y) * 18), false)); + for(x = 0; x < 9; x++) + addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142, x == inv.currentItem)); + for(y = 0; y < 3; y++) + for(x = 0; x < 9; x++) + addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x, 84 + y * 18)); + for(y = 0; y < 3; y++) + for(x = 0; x < 9; x++) + addSlotToContainer(new SlotRingChest(chest, 26 - (x + y * 9), 8 + 18 * (8 - x), 17 + (2 - y) * 18, false)); } + /** + * @param player + * @return + */ @Override public boolean canInteractWith(EntityPlayer player) { return true; } + /** + * @param par1EntityPlayer + * @param par2 + * @return + */ @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) - { + Slot slot = (Slot)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(); - } + if (par2 < 27){ + if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true)) return null; + }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null; + if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null); + else slot.onSlotChanged(); } - return itemstack; } } |
