# Compressor

Compact Compressor uses the same recipes. At least one fluid input is required.

Rows are keyed by the first input fluid's type and pressure; the input pressure is the compression level selected in the GUI. Among rows with the same key, the last by `order` applies. The first output fluid sets the output type, amount and pressure. A fluid and pressure without a row compresses 1,000 mB to the next pressure level. Speed and overdrive upgrades shorten `duration` to at least one tick.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | Selects the `hbm:compressor` recipe format. | |
| `name` (Optional) | Internal lookup name; defaults to the last segment of the recipe resource path. | |
| `input_fluids` | Ordered fluid inputs with amount and pressure; defaults to an empty list. | |
| `input_fluids.type` | Registered fluid ID. | |
| `input_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `input_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `output_fluids` | Ordered fluid outputs with amount and pressure; defaults to an empty list. | |
| `output_fluids.type` | Registered fluid ID. | |
| `output_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `output_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `duration` | Process duration in ticks; defaults to 0. | `i32` |
| `order` (Optional) | Sort position within the recipe table; lower values first, default 2147483647. | `i32` |

## Example

Source path: `data/hbm/recipe/compressor/compressor.petroleum_1.json`

```json
{
  "type": "hbm:compressor",
  "duration": 20,
  "input_fluids": [
    {
      "type": "hbm:petroleum",
      "amount": 2000,
      "pressure": 1
    }
  ],
  "order": 1,
  "output_fluids": [
    {
      "type": "hbm:lpg",
      "amount": 1000
    }
  ]
}
```
