Warehouse - P3pp3rF1y/AncientWarfare2 GitHub Wiki
Ancient Warfare Warehouse
The Warehouse is meant as an upgradeable self-sorting and auto-organizing mass item storage area. It has work bounds like other Worksites, but is also a Multi-block structure in that it requires other blocks for its functionality. The Warehouse comprises four different types of blocks – the Warehouse Control Block, Warehouse Storage blocks, Warehouse Interface blocks, and Warehouse Stock Viewer Signs. Additionally there is a Warehouse Crafting Station to allow a Player to use items directly from the warehouse for crafting, and the Stock Linker for controlling production in the AW system.
Control Block
The Warehouse Control Block serves as the core of the Warehouse Multiblock system. Similarly to the Machines, the Control Block manages the bounds of the Warehouse, and is the target for energy input, either by a Torque Generating Machine, or a Craftsman NPC. In of itself, the Control Block does not provide any storage, and storage must be provided by the Warehouse Storage Blocks. The Control Block has does not have ANY accessible inventories, and cannot be accessed for automatic item transfer, which must be done through the Warehouse Interfaces. While the Control Block does not have any storage or actual inventories, it provides the means to see any and all items within the Warehouse, filter view by item name, and manually input and withdraw items from the Storage Blocks.
Without any upgrades, the Control Block has default bounds of 5x5x4 blocks, but this can be increased by using the Bounds Upgrades, same as the Machines. Once in the Control Block, the bounds can be adjusted in the “Bounds” button in the GUI.
Storage Blocks and their Tiers
Warehouse Storage blocks provide a means to expand the capacity of the Warehouse. Every additional Storage block placed within the managed bounds will increase the total capacity of the warehouse by a set amount; higher grades of Storage block add more capacity than lower grades. Items are actually stored in these Storage blocks. If you break a Storage block all items it contains will be dropped in the world and no longer available in the Warehouse. Players may manually add and remove items from the Storage blocks, but their main use is for the Warehouse Control Block to manage their stored items Warehouse Storage blocks may be interacted with to view or manipulate contents or to set content filters. Once a filter is set, only items matching that filter will be placed into that storage block; any existing items will be left in place. An empty filter list denotes that any item may be stored there. An empty filter matches no items (and thus a storage block with a single empty filter will not store any items). These blocks do not provide any externally accessible inventories, all automated interaction must go through the Warehouse Interface blocks.
Interface
Warehouse Interface blocks provide the means to access the items in the Warehouse through external and automated processes. These blocks provide an externally accessible inventory that may be directly manipulated by NPC Couriers, vanilla hoppers, or any other mod-added means of manipulating block-based inventories. These Interfaces MUST be WITHIN the bounds of the Warehouse and the Warehouse Control Block MUST BE POWERED to facilitate item transfer between the Interfaces and the Storage Blocks. The Interface block serves as both the input and output for the Warehouse, and every Interface block may be used as input, output, or both. The Warehouse Interface block can be interacted with to open up a GUI to control its filter list. The filter list determines what items will be automatically placed into the interface, and which items should be automatically removed. Any items in the filter list will be automatically placed into the Interface block at regular intervals by the Control Block, up to the quantity specified in the filter. Any items not in the filter list will be automatically removed from the Interface block at regular intervals by the Control Block.
Stock Linker
The Stock Linker is a sign-like block that is designed to communicate between the Warehouse and Machines out in the fields. It can be used to tell Machines to cease operating based on the quantities of items in the Warehouse. Therefore, it does not belong within the bounds of the Warehouse, but does need to be linked to a Warehouse. To do so, hold the Stock Linker in your hand, and then sneak-right click on the Warehouse you want it to link to. There will be a message stating the Warehouse for the Stock Linker is set, and will display its coordinates. Now the Stock Linker is ready to be placed, and in order to work properly, the Stock Linker MUST be placed on any side of the Machine, which can be done by sneak-placing on the Machine. Finally, you can right click the Stock Linker to open its GUI, which is similar to the Warehouse Interfaces. You must add a new filter, set the item you want to track, set the equality sign, and the comparison value. This works by checking the amount of the item, the item that is set in the filter, in the linked Warehouse, and comparing it to the value set in the comparison value via the equality sign. Once the equality value is met, the Stock Linker will emit a form of Redstone that will disable the Machine it is attached to. If the equality is no longer met, the Stock Linker will cease emitting its signal, and will allow the Machine to function. Up to four filters can be put on a single Stock Linker, and the top one has the highest priority, the bottom one has the lowest priority.
Crafting Station
The Warehouse Crafting Station must be placed on top of a Warehouse Control block (not within the bounds), and works with materials from a single Warehouse. Like other crafting stations, the recipe may be laid out in the recipe grid. Results may be pulled from the result slot. Any resources needed from crafting will be pulled from the Warehouse’s Storage blocks.
Stock Viewer
Allows for creating a ‘sign’ that will display the quantity of specific items stored in a warehouse. It must be placed inside or on the side of block inside the warehouse bounds. It has a configurable list of what items it will display; these are setup similar to the warehouse interface filters.