5 This API is kept simple by adding a single command which allows mods to add
6 containers like chests and furnaces to the hopper check list.
12 Make sure any mods using this function has 'hopper' in the depends.txt file.
14 hopper:add_container({ {"where_from", "node_name", "inventory_name"} })
16 'where_from' is a string telling the api that items are coming from either
17 the 'top' node into a hopper below, going into the 'bottom' node
18 from the hopper above or coming from a 'side' hopper into the
21 'node_name" is the name of the container itself (e.g. "default:chest")
23 'inventory_name' is the name of the container inventory that is affected.
27 hopper:add_container({
28 {"top", "default:furnace", "dst"}, -- take cooked items from above into hopper below
29 {"bottom", "default:furnace", "src"}, -- insert items below to be cooked from hopper above
30 {"side", "default:furnace", "fuel"}, -- replenish furnace fuel from hopper at side
33 You can also register hopper interaction targets by group, or by a group and a specific group
36 hopper:add_container({
37 {"top", "group:loot_chest", "loot"},
38 {"bottom", "group:loot_chest", "loot"},
39 {"side", "group:loot_chest", "loot"},
42 Would cause hoppers to interact with the "loot" inventory of all nodes belonging to the group
45 hopper:add_container({
46 {"top", "group:protected_container=1", "main"},
47 {"bottom", "group:protected_container=1", "main"},
48 {"side", "group:protected_container=1", "main"},
51 Would cause hoppers to interact with the "main" inventory of nodes belonging to the group
52 "protected_container" provided they had a value of 1 in that group. Hoppers prioritize the most
53 specific definition first; they check for registrations for a specific node name, then
54 for registrations that apply to a node's group and group value, and then for registrations
55 applying to a node's group in general.
57 Note that if multiple group registrations apply to the same node it's undefined which group
58 will take priority. Using the above examples, if there were a node that belonged to *both*
59 the groups "loot_chest" and "protected_container=1" there's no way of knowing ahead of time
60 whether hoppers would interact with the "loot" or "main" inventories. Try to avoid this situation.
62 The hopper mod already have support for the wine barrel inside of the Wine mod and protected
63 chests inside of Protector Redo, as well as default chests, furnaces and hoppers