hopper/api.txt
2017-02-01 21:00:57 -07:00

37 lines
1.2 KiB
Plaintext

Hopper API
----------
This API is kept simple by adding a single command which allows mods to add
containers like chests and furnaces to the hopper check list.
Command Usage
-------------
Make sure any mods using this function has 'hopper' in the depends.txt file.
hopper:add_container({ {"where_from", "node_name", "inventory_name"} })
'where_from' is a string telling the api that items are coming from either
the 'top' node into a hopper below, going into the 'bottom' node
from the hopper above or coming from a 'side' hopper into the
node next door.
'node_name" is the name of the container itself (e.g. "default:chest")
'inventory_name' is the name of the container inventory that is affected.
e.g.
hopper:add_container({
{"top", "default:furnace", "dst"}, -- take cooked items from above into hopper below
{"bottom", "default:furnace", "src"}, -- insert items below to be cooked from hopper above
{"side", "default:furnace", "fuel"}, -- replenish furnace fuel from hopper at side
})
We already have support for the wine barrel inside of the Wine mod and protected
chests inside of Protector Redo, as well as default chests, furnaces and hoppers
themselves.