ResourceAccessor

ResourceAccessor

class

Accessor that transfers a resource through a block side

Fields

NameTypeDescription
inventory ResourceInventory Resource inventory bound to this side
is_input boolean Side consumes the resource
is_output boolean Side produces the resource
channel string Resource network channel name

Functions

ResourceAccessor:init(side, pos, inventory, is_input, is_output, channel)

Configure side, position, inventory and channel at once

side Vec3i Side direction of the owning block
pos Vec3i Block local position
inventory ResourceInventory Resource inventory to bind
is_input boolean Side consumes the resource
is_output boolean Side produces the resource
channel string Resource network channel name
Standard members (3)

Generated for every class of this kind by the game's codegen, not written for ResourceAccessor.

ResourceAccessor.cast(object) Trying to cast Object into ResourceAccessor
ResourceAccessor.get_class() Return ResourceAccessor class object
ResourceAccessor.new(parent, name) Creates a new ResourceAccessor attached to a block
Inherited from Accessor (5)
  • side Side direction of the owning block
  • pos Block local position
  • owner Block this accessor belongs to
  • cover Cover prototype placed on this side
  • Accessor:neighbor() Accessor of the neighbor block this side touches, nil when nothing is attached to it
Inherited from Instance (1)
Inherited from Object (3)

Used by