An array of fluid boxes. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe.
A fluid box is represented as a table:
Do note that reading from a LuaFluidBox creates a new table and writing will copy the given fields from the table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back. Directly accessing the returned table's attributes won't have the desired effect.
entity's first fluid box.
fluid = entity.fluidbox
fluid.temperature = fluid.temperature * 2
entity.fluidbox = fluid
Number of fluid boxes.
Access, set or clear a fluid box. The index must always be in bounds (see LuaFluidBox::operator #);
new fluidboxes may not be added or removed using this operator. If the given fluid box doesn't contain any
nil is returned. Similarly,
nil can be written to a fluid box to remove all fluid from it.