Fuel items

FuelTypes lists the items that the game’s machines burn as fuel and says how each one burns. Each one is a FuelTypeInfo.

FuelTypes the fuel data of each item

This is the class you start from. All() lists every item with fuel data, and Get(itemId) looks one up by its item number.

public static class FuelTypes
{
    public static List<FuelTypeInfo> All();
    public static FuelTypeInfo Get(int itemId);
}
Method Returns What it does
All() List<FuelTypeInfo> Every item that has fuel data.
Get(itemId) FuelTypeInfo One item’s fuel data. null when it has none.

FuelTypeInfo how one item behaves as fuel

All() and Get(itemId) on FuelTypes give you this, one per item that has fuel data. It is filled from the ItemFueldata metadata on each item in the game’s item database. (It reads ItemDatabase.database.)

public sealed class FuelTypeInfo
{
    public int ItemId { get; }
    public int BurnSeconds { get; }
    public int BurntItemId { get; }
    public float BurntItemAmount { get; }
}
Property Type What it means
ItemId int The item’s number in the game.
BurnSeconds int How many seconds one unit burns, before a machine’s own speed factor.
BurntItemId int The item left behind when it burns. -1 when it leaves nothing.
BurntItemAmount float How many of that leftover item one unit leaves.

Things to know

  • All() lists every item the game gives fuel data to. A generator burns such an item for BurnSeconds for each unit and leaves BurntItemAmount of BurntItemId for each unit. (It lists every item in the game’s item database that has ItemFueldata metadata. BurnSeconds is ItemFueldata.burntime, BurntItemId is ItemFueldata.burntItem, and BurntItemAmount is the refuse items per unit burned.)
  • A machine may accept some items that are not in this list. Those burn for 60 seconds per unit. Which items a machine accepts is on the Power devices page, in FuelItemIds. (An item with no fuel data that a machine accepts through its FuelCategories burns 60 seconds per unit.)
  • Get(itemId) returns null for an item with no fuel data. That includes an item number the game does not have.

Limits

  • BurnSeconds does not include a machine’s own speed factor. Each machine can burn faster or slower than the number here. The factor is PowerDeviceInfo.BurnTimeFactor on the Power devices page. When a machine runs out of fuel, PowerDevices.FuelRanOut tells you.
  • Liquids are not in this list. A container of liquid burns as long as the liquid’s burn time multiplied by the amount of liquid. If the liquid has no fuel data, it burns 60 seconds per unit. (burntime times the liquid amount, or 60 per unit when the liquid has no fuel data.)
  • Battery fuel and minitrain fuel are not in this list. The game keeps them in other places, so this API can’t report them yet. (Battery fuel uses ammo and liquid metadata, not ItemFueldata. Minitrain fuel is a private acceptedFuels list.)