diff options
author | Novatux <nathanael.courant@laposte.net> | 2013-01-16 20:16:14 +0100 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2013-01-16 20:16:14 +0100 |
commit | 78d183011ec5d33867e63e124e6c25785e5df14c (patch) | |
tree | 7e7fdbe5fafe963f2a1749c915cea5d7dd676272 /item_transport.lua | |
parent | d5f7f5fb8a963735a9e6a79f8ad1979b68990c72 (diff) |
Added a function to register tubes.
Added the mese pipe.
Diffstat (limited to 'item_transport.lua')
-rw-r--r-- | item_transport.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/item_transport.lua b/item_transport.lua index 9f7f726..db057aa 100644 --- a/item_transport.lua +++ b/item_transport.lua @@ -269,6 +269,7 @@ function go_next(pos,velocity,stack) --print(dump(pos)) local chests={} local tubes={} + local cnode=minetest.env:get_node(pos) local cmeta=minetest.env:get_meta(pos) local node local meta @@ -276,7 +277,13 @@ function go_next(pos,velocity,stack) local tube_receiver local len=1 local n - for _,vect in ipairs(adjlist) do + local can_go + if minetest.registered_nodes[cnode.name].tube and minetest.registered_nodes[cnode.name].tube.can_go then + can_go=minetest.registered_nodes[cnode.name].tube.can_go(pos,node,velocity,stack) + else + can_go=adjlist + end + for _,vect in ipairs(can_go) do if vect.x~=-velocity.x or vect.y~=-velocity.y or vect.z~=-velocity.z then npos=addVect(pos,vect) node=minetest.env:get_node(npos) |