Skip to content
tofof edited this page Nov 22, 2017 · 6 revisions
The drawer controller is an advanced inventory routing block and the heart of a drawer network. A Drawer Network is a concept for a group of connected drawers managed by a single Drawer Controller. By interfacing with a controller or Controller Slave, the entire network of drawers can be exposed to the player or an external system as a single large inventory.

Range

A controller has a default range of 12 blocks along any axis. Thus it can "see" any drawer within a 25x25x25 cube centered around the controller, so long as the drawer is connected directly to the controller or by a chain of other drawers or trim blocks, and the chain is itself fully contained within that bounding cube. It does not matter if the chain itself is long and winds around. In this sense, drawers implicitly act as pipes for the storage network. Trim blocks are an alternative connecting block.

Manual Interaction

A controller can be interacted with manually to insert items into connected drawers. A single right-click with an item will insert that item into the drawer network. Double right-clicking will attempt to dump your entire inventory into the drawer network, as long as there is a corresponding item already held in one of the destination drawers.

Using a Drawer Key on a controller will cause all connected drawers to lock or unlock. Using a Concealment Key on a controller will cause any connected drawers to show or hide their labels.

Automatic Interaction

Controllers can be hooked up to hoppers, pipes, ducts, storage buses, or any other block that expects to work with a generic Inventory (like a chest). These external devices and transport blocks will be able to pull any item from the connected drawer network, or insert items into the network.

If you want to attach more devices to a controller than can be physically accommodated, strongly prefer using a Controller Slave for these extra connections rather than adding another controller to the network. Controllers need to perform considerable bookkeeping compared to slaves, which are practically free in terms of server resources.

Drawer Networks

Network Building

Drawer controllers rebuild their internal network directory every 5 seconds. Thus if you add or remove a drawer from the network, it may take up to 5 seconds for that change to be recognized. Even if you sever the entire network from its controller, the controller will still maintain its "connection" to those drawers for a short period.

Item Insertion

When items are inserted into a controller (or a bound slave), drawer slots are searched with the following priorities:

  • Look for any drawers that are locked and contain the same item.
  • Look for any drawers that are locked and have a void upgrade and contain the same item.
  • Look for any drawers that are unlocked and contain the same item.
  • Look for any drawers that are unlocked and have a void upgrade and contain the same item.
  • Look for any drawers that are unlocked and are empty.

If an item can't be placed for a given rule because a drawer is full, it will look to the next rule. If more than one valid destination is found at the highest applicable priority, then the slot nearest the controller (by connection length) will generally be chosen.

A note on network rebuilds: If the status of a drawer changes (such as whether it's locked or empty), that change will not be recognized until the controller performs its periodic rebuild. This can cause items to route unexpectedly, such as an item being placed into a freshly emptied slot when there is another drawer further away that still has room. This can be avoided by locking drawers. Network rebuilds may be made more intelligent in a future release.