2017-04-05 08:57:22 +02:00
|
|
|
|
2015-01-29 22:36:16 +01:00
|
|
|
-- the default tube and default textures
|
|
|
|
pipeworks.register_tube("pipeworks:tube", "Pneumatic tube segment")
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "pipeworks:tube_1 6",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
|
|
|
{ "", "", "" },
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2017-04-05 08:57:22 +02:00
|
|
|
pipeworks.register_tube("pipeworks:broken_tube", {
|
|
|
|
description = "Broken Tube (you hacker you)",
|
|
|
|
plain = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
|
|
|
|
noctr = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
|
|
|
|
ends = { { name = "pipeworks_broken_tube_end.png", color = nodecolor } },
|
|
|
|
short = { name = "pipeworks_broken_tube_short.png", color = nodecolor },
|
|
|
|
node_def = {
|
|
|
|
drop = "pipeworks:tube_1",
|
|
|
|
groups = {not_in_creative_inventory = 1, tubedevice_receiver = 1},
|
|
|
|
tube = {
|
|
|
|
insert_object = function(pos, node, stack, direction)
|
|
|
|
minetest.item_drop(stack, nil, pos)
|
|
|
|
return ItemStack("")
|
|
|
|
end,
|
|
|
|
can_insert = function(pos,node,stack,direction)
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
priority = 50,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-02-03 15:35:44 +01:00
|
|
|
-- the high priority tube is a low-cpu replacement for sorting tubes in situations
|
|
|
|
-- where players would use them for simple routing (turning off paths)
|
|
|
|
-- without doing actual sorting, like at outputs of tubedevices that might both accept and eject items
|
|
|
|
if pipeworks.enable_priority_tube then
|
|
|
|
local color = "#ff3030:128"
|
2017-01-25 10:33:27 +01:00
|
|
|
local nodecolor = 0xffff3030
|
2015-02-03 15:35:44 +01:00
|
|
|
pipeworks.register_tube("pipeworks:priority_tube", {
|
|
|
|
description = "High Priority Tube Segment",
|
|
|
|
inventory_image = "pipeworks_tube_inv.png^[colorize:" .. color,
|
2017-01-25 10:33:27 +01:00
|
|
|
plain = { { name = "pipeworks_tube_plain.png", color = nodecolor } },
|
|
|
|
noctr = { { name = "pipeworks_tube_noctr.png", color = nodecolor } },
|
|
|
|
ends = { { name = "pipeworks_tube_end.png", color = nodecolor } },
|
|
|
|
short = { name = "pipeworks_tube_short.png", color = nodecolor },
|
2015-02-03 15:35:44 +01:00
|
|
|
node_def = {
|
|
|
|
tube = { priority = 150 } -- higher than tubedevices (100)
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "pipeworks:priority_tube_1 6",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
|
|
|
{ "default:gold_ingot", "", "default:gold_ingot" },
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-01-29 22:24:14 +01:00
|
|
|
if pipeworks.enable_accelerator_tube then
|
2015-01-31 16:10:25 +01:00
|
|
|
pipeworks.register_tube("pipeworks:accelerator_tube", {
|
|
|
|
description = "Accelerating Pneumatic Tube Segment",
|
|
|
|
inventory_image = "pipeworks_accelerator_tube_inv.png",
|
|
|
|
plain = { "pipeworks_accelerator_tube_plain.png" },
|
|
|
|
noctr = { "pipeworks_accelerator_tube_noctr.png" },
|
|
|
|
ends = { "pipeworks_accelerator_tube_end.png" },
|
|
|
|
short = "pipeworks_accelerator_tube_short.png",
|
|
|
|
node_def = {
|
|
|
|
tube = {can_go = function(pos, node, velocity, stack)
|
2015-01-29 22:24:14 +01:00
|
|
|
velocity.speed = velocity.speed+1
|
|
|
|
return pipeworks.notvel(pipeworks.meseadjlist, velocity)
|
|
|
|
end}
|
2015-01-31 16:10:25 +01:00
|
|
|
},
|
2015-01-29 22:24:14 +01:00
|
|
|
})
|
2015-01-29 22:47:33 +01:00
|
|
|
minetest.register_craft( {
|
|
|
|
output = "pipeworks:accelerator_tube_1 2",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
|
|
|
{ "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" },
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
|
|
|
},
|
|
|
|
})
|
2015-01-29 22:24:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if pipeworks.enable_crossing_tube then
|
2015-01-31 16:10:25 +01:00
|
|
|
pipeworks.register_tube("pipeworks:crossing_tube", {
|
|
|
|
description = "Crossing Pneumatic Tube Segment",
|
|
|
|
inventory_image = "pipeworks_crossing_tube_inv.png",
|
|
|
|
plain = { "pipeworks_crossing_tube_plain.png" },
|
|
|
|
noctr = { "pipeworks_crossing_tube_noctr.png" },
|
|
|
|
ends = { "pipeworks_crossing_tube_end.png" },
|
|
|
|
short = "pipeworks_crossing_tube_short.png",
|
|
|
|
node_def = {
|
|
|
|
tube = {can_go = function(pos, node, velocity, stack) return {velocity} end }
|
|
|
|
},
|
2015-01-29 22:24:14 +01:00
|
|
|
})
|
2015-01-29 22:47:33 +01:00
|
|
|
minetest.register_craft( {
|
|
|
|
output = "pipeworks:crossing_tube_1 5",
|
|
|
|
recipe = {
|
|
|
|
{ "", "pipeworks:tube_1", "" },
|
|
|
|
{ "pipeworks:tube_1", "pipeworks:tube_1", "pipeworks:tube_1" },
|
|
|
|
{ "", "pipeworks:tube_1", "" }
|
|
|
|
},
|
|
|
|
})
|
2015-01-29 22:24:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if pipeworks.enable_one_way_tube then
|
|
|
|
minetest.register_node("pipeworks:one_way_tube", {
|
|
|
|
description = "One way tube",
|
|
|
|
tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png",
|
|
|
|
"pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"},
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = {type = "fixed",
|
|
|
|
fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}},
|
|
|
|
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
tube = {
|
|
|
|
connect_sides = {left = 1, right = 1},
|
|
|
|
can_go = function(pos, node, velocity, stack)
|
|
|
|
return {velocity}
|
|
|
|
end,
|
|
|
|
can_insert = function(pos, node, stack, direction)
|
2017-04-04 09:25:27 +02:00
|
|
|
local dir = pipeworks.facedir_to_right_dir(node.param2)
|
2015-01-29 22:24:14 +01:00
|
|
|
return vector.equals(dir, direction)
|
|
|
|
end,
|
|
|
|
priority = 75 -- Higher than normal tubes, but lower than receivers
|
|
|
|
},
|
2015-02-07 08:45:17 +01:00
|
|
|
after_place_node = pipeworks.after_place,
|
|
|
|
after_dig_node = pipeworks.after_dig,
|
2015-01-29 22:24:14 +01:00
|
|
|
})
|
2015-01-29 22:47:33 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "pipeworks:one_way_tube 2",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
|
|
|
{ "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" },
|
|
|
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
|
|
|
},
|
|
|
|
})
|
2015-01-29 22:24:14 +01:00
|
|
|
end
|