Added a function to register tubes.

Added the mese pipe.
This commit is contained in:
Novatux
2013-01-16 20:16:14 +01:00
parent d5f7f5fb8a
commit 78d183011e
24 changed files with 161 additions and 43 deletions

View File

@ -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)