Storages
Available since 0.1.0
Inventories, tanks and batteries. Slots and slot limits, capacities, directions, filters and what players may put in.
A machine keeps everything it works with in storages. A storage is one inventory, one tank or one battery. Each machine lists its storages in storages, and every storage has an id that recipes and screens use to point at it.
Item storages
An item storage is an inventory made of slots. slots is how many slots it has:
{
"id": "input",
"resource_type": "foundry_apparatus:item",
"slots": 2,
"direction": "in"
}Each slot holds one kind of item. Two slots can hold two different items at the same time, for example copper in one and tin in the other.
Slot limit: how many fit in one slot
Without slot_limit, a slot works like a chest slot: it holds one stack of its item (64 raw iron, 16 ender pearls). Add slot_limit when one slot should hold more:
{
"id": "input",
"resource_type": "foundry_apparatus:item",
"slots": 1,
"slot_limit": 10000,
"direction": "in"
}Now the single slot holds up to 10,000 of one item. That is perfect for big recipes, such as one that needs thousands of ingots. Large numbers are shortened on screen, so 10,000 shows as 10k.
The two settings answer different questions:
| Setting | Question it answers | Example |
|---|---|---|
slots | How many different items fit at once? | An alloy recipe that needs copper and tin needs 2 slots. |
slot_limit | How many of each fit? | A recipe that needs 10,000 ingots needs a slot limit of at least 10,000. |
You can use up to 1,024 slots per storage and a slot limit of up to 1,000,000,000.
When a player or a hopper takes items out, at most one normal stack leaves at a time, so a slot holding 10,000 items never puts an impossible stack in someone's inventory.
What players and hoppers may put in
An input storage only accepts items that one of the machine's recipes uses. Try putting dirt in a smelter: it is refused, by hand, by hopper and by pipe. This keeps junk from clogging the machine, and it updates by itself whenever you add recipes and type /reload.
To accept anything, set accept to any:
{
"id": "buffer",
"resource_type": "foundry_apparatus:item",
"slots": 9,
"direction": "in",
"accept": "any"
}| Value | What the storage accepts |
|---|---|
recipe_inputs (default) | Only items used by one of the machine's recipes in this storage. |
any | Any item (still limited by the filter, if there is one). |
accept only applies to input storages that hold items.
Fluid, energy and experience storages
Tanks, batteries and experience use capacity instead of slots. The number is in the unit of the resource:
{
"id": "water_in",
"resource_type": "foundry_apparatus:fluid",
"capacity": 8000,
"direction": "in"
}| Resource type | Unit of capacity | Example |
|---|---|---|
foundry_apparatus:fluid | millibuckets (mB); one bucket is 1000 mB | 8000 holds 8 buckets. |
foundry_apparatus:energy | FE (Forge Energy) | 50000 holds 50,000 FE. |
foundry_apparatus:xp | experience points | 1395 is enough for level 30. |
Players can fill and empty tanks with buckets right from the machine's screen.
Directions
direction says which way things may flow through hoppers, pipes and cables:
| Value | What it means |
|---|---|
in | Things can only be put in. Recipes take from it. |
out | Things can only be taken out. Recipes put their results in it. |
both | Both ways. |
Players using the screen follow the same rules: they can take results out of an out storage, but cannot put things in it.
Filters
A filter restricts a storage to certain resources. A tank that only accepts water:
{
"id": "water_in",
"resource_type": "foundry_apparatus:fluid",
"capacity": 8000,
"direction": "in",
"filter": [
{
"id": "minecraft:water"
}
]
}A filter entry can name one resource with id or a whole group with tag.
What is next
Storages are where recipes take from and put into: see Recipes. To decide which side of the machine each storage uses, see Sides and Automation. Every field is listed in the machine reference.