stack_size

class StackSizeMixin(name: str, similar_entities: list[str], **kwargs: dict)

(Implicitly inherits ControlBehaviorMixin)

Gives the entity a stack size attribute. Allows it to give a constant, overridden stack size and a circuit-set stack size.

property circuit_stack_size_enabled: bool

Sets if the inserter’s stack size is controlled by circuit signal.

Getter:

Gets whether or not the circuit stack size is enabled, or None if not set.

Setter:

Sets whether or not the circuit stack size is enabled. Removes the key if set to None.

Type:

bool

Raises:

TypeError – If set to anything other than a bool or None.

property override_stack_size: int

Sets an inserter’s stack size override. Will use this unless a circuit stack size is set and enabled.

Getter:

Gets the overridden stack size.

Setter:

Sets the overridden stack size.

Type:

int

Raises:

TypeError

property stack_control_signal: dict

Specify the stack size input signal for the inserter if enabled.

Stored as a dict in the format {"name": str, "type": str}, where name is the name of the signal and type is it’s type, either "item", "fluid", or "signal".

However, because a signal’s type is always constant and can be inferred, it is recommended to simply set the attribute to the string name of the signal which will automatically be converted to the above format.

Getter:

Gets the stack control signal, or None if not set.

Setter:

Sets the stack control signal. Removes the key if set to None.

Type:

draftsman.signatures.SIGNAL_ID

Raises:
  • InvalidSignalID – If set to a string that is not a valid signal name.

  • DataFormatError – If set to a dict that does not match the dict format specified above.