summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decorative_tubes.lua79
-rw-r--r--init.lua1
-rw-r--r--textures/pipeworks_pane_embedded_tube_ends.pngbin0 -> 1195 bytes
-rw-r--r--textures/pipeworks_pane_embedded_tube_sides.pngbin0 -> 963 bytes
4 files changed, 80 insertions, 0 deletions
diff --git a/decorative_tubes.lua b/decorative_tubes.lua
new file mode 100644
index 0000000..90e92d9
--- /dev/null
+++ b/decorative_tubes.lua
@@ -0,0 +1,79 @@
+local straight = function(pos, node, velocity, stack) return {velocity} end
+
+minetest.register_node("pipeworks:steel_block_embedded_tube", {
+ description = "Airtight steelblock embedded tube",
+ tiles = {
+ "default_steel_block.png", "default_steel_block.png",
+ "default_steel_block.png", "default_steel_block.png",
+ "default_steel_block.png^pipeworks_tube_connection_metallic.png",
+ "default_steel_block.png^pipeworks_tube_connection_metallic.png",
+ },
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
+ legacy_facedir_simple = true,
+ sounds = default.node_sound_stone_defaults(),
+ tube = {
+ connect_sides = {front = 1, back = 1,},
+ priority = 50,
+ can_go = straight,
+ can_insert = function(pos, node, stack, direction)
+ local dir = minetest.facedir_to_dir(node.param2)
+ return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
+ end,
+ },
+})
+
+minetest.register_craft( {
+ output = "pipeworks:steel_block_embedded_tube 1",
+ recipe = {
+ { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
+ { "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" },
+ { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }
+ },
+})
+
+local pane_box = {
+ type = "fixed",
+ fixed = {
+ { -9/64, -9/64, -8/16, 9/64, 9/64, 8/16 }, -- tube
+ { -8/16, -8/16, -1/16, 8/16, 8/16, 1/16 } -- pane
+ }
+}
+minetest.register_node("pipeworks:steel_pane_embedded_tube", {
+ drawtype = "nodebox",
+ description = "Airtight panel embedded tube ",
+ tiles = {
+ "pipeworks_pane_embedded_tube_sides.png^[transformR90",
+ "pipeworks_pane_embedded_tube_sides.png^[transformR90",
+ "pipeworks_pane_embedded_tube_sides.png",
+ "pipeworks_pane_embedded_tube_sides.png",
+ "pipeworks_pane_embedded_tube_ends.png", "pipeworks_pane_embedded_tube_ends.png",
+ },
+ node_box = pane_box,
+ selection_box = pane_box,
+ collision_box = pane_box,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
+ legacy_facedir_simple = true,
+ sounds = default.node_sound_stone_defaults(),
+ tube = {
+ connect_sides = {front = 1, back = 1,},
+ priority = 50,
+ can_go = straight,
+ can_insert = function(pos, node, stack, direction)
+ local dir = minetest.facedir_to_dir(node.param2)
+ return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
+ end,
+ },
+})
+
+minetest.register_craft( {
+ output = "pipeworks:steel_pane_embedded_tube 1",
+ recipe = {
+ { "", "pipeworks:tube_1t", "" },
+ { "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" },
+ { "", "pipeworks:tube_1", "" }
+ },
+})
diff --git a/init.lua b/init.lua
index ef8c00a..5ed4074 100644
--- a/init.lua
+++ b/init.lua
@@ -120,6 +120,7 @@ dofile(pipeworks.modpath.."/routing_tubes.lua")
dofile(pipeworks.modpath.."/sorting_tubes.lua")
dofile(pipeworks.modpath.."/vacuum_tubes.lua")
dofile(pipeworks.modpath.."/signal_tubes.lua")
+dofile(pipeworks.modpath.."/decorative_tubes.lua")
dofile(pipeworks.modpath.."/filter-injector.lua")
dofile(pipeworks.modpath.."/trashcan.lua")
dofile(pipeworks.modpath.."/wielder.lua")
diff --git a/textures/pipeworks_pane_embedded_tube_ends.png b/textures/pipeworks_pane_embedded_tube_ends.png
new file mode 100644
index 0000000..93cc2d0
--- /dev/null
+++ b/textures/pipeworks_pane_embedded_tube_ends.png
Binary files differ
diff --git a/textures/pipeworks_pane_embedded_tube_sides.png b/textures/pipeworks_pane_embedded_tube_sides.png
new file mode 100644
index 0000000..c5f177e
--- /dev/null
+++ b/textures/pipeworks_pane_embedded_tube_sides.png
Binary files differ