@Override public void setInventorySlotContents(int i, ItemStack itemstack) { metalItemStacks[i] = itemstack; if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { itemstack.stackSize = getInventoryStackLimit(); } }