Skip to content

Commit

Permalink
Specify stack limit for slots at creation time. Fixes equipping 10 kn…
Browse files Browse the repository at this point in the history
…apsacks
  • Loading branch information
Qowyn committed Sep 23, 2014
1 parent 518de71 commit a0a9e22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Expand Up @@ -16,13 +16,15 @@ public ArmorExtendedContainer(InventoryPlayer inventoryplayer, ArmorExtended arm
invPlayer = inventoryplayer;
this.armor = armor;

this.addSlotToContainer(new SlotAccessory(armor, 0, 80, 17));
this.addSlotToContainer(new SlotAccessory(armor, 1, 80, 35));
this.addSlotToContainer(new SlotAccessory(armor, 2, 116, 17));
this.addSlotToContainer(new SlotAccessory(armor, 3, 116, 35));
this.addSlotToContainer(new SlotAccessory(armor, 4, 152, 53));
this.addSlotToContainer(new SlotAccessory(armor, 5, 152, 35));
this.addSlotToContainer(new SlotAccessory(armor, 6, 152, 17));
this.addSlotToContainer(new SlotAccessory(armor, 0, 80, 17, 1));
this.addSlotToContainer(new SlotAccessory(armor, 1, 80, 35, 1));
this.addSlotToContainer(new SlotAccessory(armor, 2, 116, 17, 1));
this.addSlotToContainer(new SlotAccessory(armor, 3, 116, 35, 1));

// HeartCanister
this.addSlotToContainer(new SlotAccessory(armor, 4, 152, 53, 10));
this.addSlotToContainer(new SlotAccessory(armor, 5, 152, 35, 10));
this.addSlotToContainer(new SlotAccessory(armor, 6, 152, 17, 10));
for (int playerArmor = 0; playerArmor < 4; ++playerArmor)
{
this.addSlotToContainer(new SlotArmorCopy(this, inventoryplayer, inventoryplayer.getSizeInventory() - 1 - playerArmor, 98, 8 + playerArmor * 18, playerArmor));
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/tconstruct/armor/inventory/SlotAccessory.java
Expand Up @@ -7,12 +7,13 @@
public class SlotAccessory extends Slot
{
private final int slotID;
private final int slotStackLimit;

public SlotAccessory(IInventory par2IInventory, int par3, int par4, int par5)
public SlotAccessory(IInventory par2IInventory, int par3, int par4, int par5, int slotStackLimit)
{
super(par2IInventory, par3, par4, par5);
this.slotID = par3;
//this.parent = container;
this.slotStackLimit = slotStackLimit;
}

/**
Expand All @@ -21,7 +22,7 @@ public SlotAccessory(IInventory par2IInventory, int par3, int par4, int par5)
*/
public int getSlotStackLimit ()
{
return 10;
return slotStackLimit;
}

/**
Expand Down

0 comments on commit a0a9e22

Please sign in to comment.