mirror of
https://github.com/minetest-mods/hopper.git
synced 2024-08-20 13:14:07 +02:00
35 lines
1.1 KiB
Plaintext
35 lines
1.1 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', going to the 'bottom' or coming from the 'side'.
|
||
|
|
||
|
'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 into hopper
|
||
|
{"bottom", "default:furnace", "src"}, -- insert items to be cooked from hopper
|
||
|
{"side", "default:furnace", "fuel"}, -- replenish furnace fuel from hopper
|
||
|
})
|
||
|
|
||
|
|
||
|
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.
|