ItemGroup

ItemGroup

class

Recipe ingredient that any one of its member items satisfies, one for one

  • load-only Usable only while mods load. The game seals these members once loading finishes, so a call or a write from a running world raises an error.

Fields

NameTypeDescription
members StaticItem[] Items that satisfy the group, in the order a craft takes them

Functions

ItemGroup:matches(item)

True when item is a member of the group

item StaticItem

returns boolean

Standard members (5)

These members are available on all classes of this kind.

ItemGroup.cast(object) Trying to cast Object into ItemGroup
ItemGroup.get_class() Return ItemGroup class object
ItemGroup.find(name) Looks ItemGroup up in db, nil when there is none
ItemGroup.get(name) Takes ItemGroup from db, reports a miss to the log
ItemGroup.reg(name, spec) load-only Register a new ItemGroup static object, or take the registered one of that name
Inherited from StaticItem (18)
  • image Item image in UI
  • image_path Icon path relative to the owning mod folder
  • stack_size Size of item stack
  • sim_id read-only Number of the item in this session only, from 1 by name after init; another set of mods shifts it. What --!sim code compares; never save it
  • tier Item unlock tier
  • type load-only What the item is: "solid", "fluid" or "abstract"
  • unit_mul multiplier for UI
  • mesh Mesh for item rendering in world
  • block Buildable object pointer for this item
  • custom_data Is item instance contains CustomData
  • logic Class for item while in hand
  • lua Lua prototype table
  • tags Space separated search tags
  • category In-game database category
  • equipment_slot Equipment slot this item fits (Jetpack, Light)
  • label Localized item name
  • description_parts Localized description paragraphs
  • StaticItem:copy(name, spec) load-only Register a copy of this item under a new name; its block stays the block of the original until item.block is set
Inherited from Prototype (2)
Inherited from Object (1)