if minetest.get_modpath("pipeworks") ~= nil then
print("pipework exists")
if pipework == nil then
print("but is nil")
else
print("and is not nil")
end
else
print("pipework does not exists")
end
if minetest.get_modpath("pipeworks") ~= nil then
print("pipeworks exists")
if pipeworks == nil then
print("but is nil")
else
print("and is not nil")
end
else
print("pipeworks exists")
end
print("pipeworks is: "..dump(pipeworks))
function technic.send_items(pos, x_velocity, z_velocity)
-- Send items on their way in the pipe system.
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local i = 0
for _, stack in ipairs(inv:get_list("dst")) do
i = i + 1
if stack then
local item0 = stack:to_table()
if item0 then
item0["count"] = "1"
-- Sane -> this fails
local item1 = pipeworks.tube_item({x=pos.x, y=pos.y, z=pos.z}, item0)
item1:get_luaentity().start_pos = {x=pos.x, y=pos.y, z=pos.z}
item1:setvelocity({x=x_velocity, y=0, z=z_velocity})
item1:setacceleration({x=0, y=0, z=0})
stack:take_item(1)
inv:set_stack("dst", i, stack)
return
end
end
end
end