Start machine timer on tubelib action, update README

This commit is contained in:
Evert Prants 2018-08-10 11:39:35 +03:00
parent 1673aef090
commit 39dd987e7e
No known key found for this signature in database
GPG Key ID: 1688DA83D222D0B5
2 changed files with 5 additions and 2 deletions

@ -23,5 +23,5 @@ Powered tools that you can simply recharge instead of crafting them again.
### Farming
Farming automation machines: automatic planting and harvesting of crops.
### (Planned) Nuclear
Nuclear power. Both fission and fusion will be presented!
### Nuclear
Nuclear power. Both fission and fusion will (soon) be presented!

@ -148,14 +148,17 @@ local tube = {
local tubelib_tube = {
on_pull_item = function(pos, side, player_name)
local meta = minetest.get_meta(pos)
minetest.get_node_timer(pos):start(1.0)
return tubelib.get_item(meta, "dst")
end,
on_push_item = function(pos, side, item, player_name)
local meta = minetest.get_meta(pos)
minetest.get_node_timer(pos):start(1.0)
return tubelib.put_item(meta, "src", item)
end,
on_unpull_item = function(pos, side, item, player_name)
local meta = minetest.get_meta(pos)
minetest.get_node_timer(pos):start(1.0)
return tubelib.put_item(meta, "dst", item)
end,
}