request_items
- class RequestItemsMixin(name: str, similar_entities: list[str], **kwargs: dict)
Enables an entity to request items during its construction. Note that this is not for Logistics requests such as requester and buffer chests (that’s what
RequestFiltersMixin
is for). Instead this is for specifying additional construction components, things like speed modules for beacons or productivity modules for assembling machines.- set_item_request(item: str, count: int) None
Requests an amount of an item. Removes the item request if
count
is set to0
orNone
. Managesmodule_slots_occupied
.Raises a number of warnings if the requested item is mismatched for the type of entity you’re requesting items for. For example,
ModuleLimitationWarning
will be raised when requesting an item that is not a module to a Beacon entity.- Parameters:
item – The string name of the requested item.
count – The desired amount of that item.
- Raises:
TypeError – If
item
is anything other than astr
, or ifcount
is anything other than anint
orNone
.InvalidItemError – If
item
is not a valid item name.ValueError – If
count
is less than zero.
- set_item_requests(items: dict) None
Sets all of the item requests for the Entity. Takes
items
as adict
in the format:{item_1: count_1, item_2: count_2, ...}
where
item_x
is astr
andcount_x
is a positive integer.- Parameters:
items – A dictionary of the desired items in the format specified above.
- Raises:
TypeError – If
item_x
is anything other than astr
, or ifcount_x
is anything other than anint
orNone
.InvalidItemError – If
item_x
is not a valid item name.ValueError – If
count_x
is less than zero.