RecipeInventory

RecipeInventory

class

Inventory that mirrors the slots of a recipe

  • 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
recipe Recipe

Functions

RecipeInventory:add(item, count, data) load-only

Append a recipe slot holding item with count

item StaticItem
count integer
data RecipeItemData Slot metadata, nil for a plain slot

RecipeInventory:clear() load-only

Drop every slot of this recipe side

RecipeInventory:count()

How many slots this recipe side has

returns integer Slot count

RecipeInventory:slot(index)

Item and count of a slot, counted from 1

index integer Slot number

returns ItemData An empty stack when there is no such slot

RecipeInventory:slot_data(index)

Bonus flag, chance and capacity of a slot, counted from 1

index integer Slot number

returns RecipeItemData Default metadata when there is no such slot

Standard members (4)

Every class of this kind carries these.

RecipeInventory.cast(object) Trying to cast Object into RecipeInventory
RecipeInventory.get_class() Return RecipeInventory class object
RecipeInventory.new(parent, name) Creates a new RecipeInventory instance
RecipeInventory.new_simple() Creates a new RecipeInventory instance
Inherited from Inventory (1)
Inherited from InventoryAccess (3)
Inherited from InventoryReader (3)
Inherited from Instance (1)
Inherited from Object (3)

Used by