public ContainerAmadron(EntityPlayer player) {
    super(null);
    for (int y = 0; y < ROWS; y++) {
      for (int x = 0; x < 2; x++) {
        addSlotToContainer(new SlotUntouchable(inv, y * 4 + x * 2, x * 73 + 12, y * 35 + 70));
        addSlotToContainer(new SlotUntouchable(inv, y * 4 + x * 2 + 1, x * 73 + 57, y * 35 + 70));
      }
    }
    addSyncedFields(this);
    Arrays.fill(shoppingItems, -1);

    if (!player.worldObj.isRemote) {
      IInventory inv = ItemAmadronTablet.getItemProvider(player.getCurrentEquippedItem());
      IFluidHandler fluidHandler =
          ItemAmadronTablet.getLiquidProvider(player.getCurrentEquippedItem());
      for (int i = 0; i < offers.size(); i++) {
        int amount = capShoppingAmount(i, 1, inv, fluidHandler);
        buyableOffers[i] = amount > 0;
      }
      problemState = EnumProblemState.NO_PROBLEMS;

      Map<AmadronOffer, Integer> shoppingCart =
          ItemAmadronTablet.getShoppingCart(player.getCurrentEquippedItem());
      for (Map.Entry<AmadronOffer, Integer> cartItem : shoppingCart.entrySet()) {
        int offerId = offers.indexOf(cartItem.getKey());
        if (offerId >= 0) {
          int index = getCartSlot(offerId);
          if (index >= 0) {
            shoppingItems[index] = offerId;
            shoppingAmounts[index] = cartItem.getValue();
          }
        }
      }
    }
  }
 public int capShoppingAmount(int offerId, int wantedAmount, EntityPlayer player) {
   IInventory inv = ItemAmadronTablet.getItemProvider(player.getCurrentEquippedItem());
   IFluidHandler fluidHandler =
       ItemAmadronTablet.getLiquidProvider(player.getCurrentEquippedItem());
   return capShoppingAmount(offerId, wantedAmount, inv, fluidHandler);
 }