rewrote pipeworks to use loops and tables to create the nodes. Requires far

less code now.
This commit is contained in:
Vanessa Ezekowitz 2012-08-05 21:29:59 -04:00
parent b3765b0df6
commit 151b7f023f

772
init.lua
View File

@ -1,9 +1,7 @@
-- pipeworks mod by VanessaE -- Pipeworks mod by Vanessa Ezekowitz - 2012-08-05
-- 2012-06-12
-- --
-- Entirely my own code. This mod merely supplies enough nodes to build -- Entirely my own code. This mod merely supplies enough nodes to build
-- a bunch of pipeworks in all directions and with all types of junctions. -- a bunch of pipes in all directions and with all types of junctions
-- --
-- License: WTFPL -- License: WTFPL
-- --
@ -18,655 +16,227 @@ local dbg = function(s)
end end
end end
-- Nodes (empty) local nodenames = {
"vertical",
"horizontal",
"junction_xy",
"junction_xz",
"bend_xy_down",
"bend_xy_up",
"bend_xz",
"crossing_xz",
"crossing_xy",
"crossing_xyz"
}
minetest.register_node("pipeworks:vertical", { local descriptions = {
description = "Pipe (vertical)", "vertical",
drawtype = "nodebox", "horizontal",
tile_images = { "pipeworks_pipe_end.png", "junction between X and Y axes",
"junction between X and Z axes",
"downward bend between X and Y axes",
"upward bend between X and Y axes",
"bend between X/Z axes",
"4-way crossing between X and Z axes",
"4-way crossing between X/Z and Y axes",
"6-way crossing"
}
local nodeimages = {
{"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png", "pipeworks_pipe_end.png",
"pipeworks_plain.png", "pipeworks_plain.png",
"pipeworks_plain.png", "pipeworks_plain.png",
"pipeworks_windowed_empty.png", "pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_empty.png" "pipeworks_windowed_XXXXX.png"},
},
paramtype = "light", {"pipeworks_windowed_XXXXX.png",
-- paramtype2 = "facedir", "pipeworks_windowed_XXXXX.png",
selection_box = { "pipeworks_pipe_end.png",
type = "fixed", "pipeworks_pipe_end.png",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, "pipeworks_plain.png",
}, "pipeworks_plain.png"},
node_box = {
type = "fixed", {"pipeworks_pipe_end.png",
fixed = { "pipeworks_pipe_end.png",
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, "pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png"},
{"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"},
{"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png"},
{"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png"},
{"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"},
{"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"},
{"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_windowed_XXXXX.png",
"pipeworks_windowed_XXXXX.png"},
{"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"}
}
local selectionboxes = {
{ -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, -- vertical
{ -0.5, -0.15, -0.15, 0.5, 0.15, 0.15 }, -- horizontal
{ -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 }, -- vertical with X/Z junction
{ -0.5, -0.15, -0.15, 0.5, 0.15, 0.5 }, -- horizontal with X/Z junction
{ -0.15, -0.5, -0.15, 0.5, 0.15, 0.15 }, -- bend down from X/Z to Y axis
{ -0.15, -0.15, -0.15, 0.5, 0.5, 0.15 }, -- bend up from X/Z to Y axis
{ -0.15, -0.15, -0.15, 0.5, 0.15, 0.5 }, -- bend between X and Z axes
{ -0.5, -0.15, -0.5, 0.5, 0.15, 0.5 }, -- 4-way crossing between X and Z axes
{ -0.5, -0.5, -0.15, 0.5, 0.5, 0.15 }, -- 4-way crossing between X/Z and Y axes
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, -- 6-way crossing (all 3 axes)
}
local nodeboxes = {
{{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- vertical
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 }, { -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }, { -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:horizontal", { {{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- horizontal
description = "Pipe (horizontal)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_plain.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.15, -0.15, 0.5, 0.15, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:junction_xy", { {{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- vertical with X/Z junction
description = "Pipe (junction between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 }, { -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }, { -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
{ 0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { 0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:junction_xz", { {{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 }, -- horizontal with X/Z junction
description = "Pipe (junction between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.15, -0.15, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 }, { -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, { -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xy_down", { {{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- bend down from X/Z to Y axis
description = "Pipe (downward bend between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.5, 0.15, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.1 , 0.1 }, { -0.1 , -0.45, -0.1 , 0.1 , 0.1 , 0.1 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xy_up", { {{ -0.15, 0.45 , -0.15, 0.15, 0.5, 0.15 }, -- bend up from X/Z to Y axis
description = "Pipe (upward bend between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.15, -0.15, 0.5, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, 0.45 , -0.15, 0.15, 0.5, 0.15 },
{ -0.1 , -0.1 , -0.1 , 0.1 , 0.45, 0.1 }, { -0.1 , -0.1 , -0.1 , 0.1 , 0.45, 0.1 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xz", { {{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 }, -- bend between X and Z axes
description = "Pipe (bend between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.15, -0.15, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 }, { -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xz", { {{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- 4-way crossing between X and Z axes
description = "Pipe (4-way crossing between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"
},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.15, -0.5, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 }, { -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }, { 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 }},
{{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- 4-way crossing between X/Z and Y axes
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
{{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- 6-way crossing (all 3 axes)
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 }, { -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 }, { -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 }, { -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xy", {
description = "Pipe (4-way crossing between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_windowed_empty.png",
"pipeworks_windowed_empty.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.15, 0.5, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, { -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 }, { -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }, { -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }},
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
} }
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xyz", { function fix_image_names(node, replacement)
description = "Pipe (6-way crossing between X/Y/Z axes)", outtable={}
for i in ipairs(nodeimages[node]) do
print(nodeimages[node][i])
outtable[i]=string.gsub(nodeimages[node][i], "_XXXXX", replacement)
print(outtable[i])
end
return outtable
end
-- Now define the actual nodes
for node in ipairs(nodenames) do
minetest.register_node("pipeworks:"..nodenames[node], {
description = "Empty Pipe ("..descriptions[node]..")",
drawtype = "nodebox", drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png", tiles = fix_image_names(node, "_empty"),
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"
},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
-- Nodes (full/loaded)
minetest.register_node("pipeworks:vertical_loaded", {
description = "Pipe (vertical)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_plain.png",
"pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png"
},
paramtype = "light",
-- paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:horizontal_loaded", {
description = "Pipe (horizontal)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_plain.png"
},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
selection_box = { selection_box = selectionboxes[node],
type = "fixed",
fixed = { -0.5, -0.15, -0.15, 0.5, 0.15, 0.15 },
},
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = nodeboxes[node]
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
}, },
groups = {snappy=3}, groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
walkable = true, walkable = true,
stack_max = 99,
drop = "pipeworks:horizontal"
}) })
minetest.register_node("pipeworks:junction_xy_loaded", { minetest.register_node("pipeworks:"..nodenames[node].."_loaded", {
description = "Pipe (junction between X/Y axes)", description = "Loaded Pipe ("..descriptions[node]..")",
drawtype = "nodebox", drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png", tiles = fix_image_names(node, "_loaded"),
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png"
},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
selection_box = { selection_box = selectionboxes[node],
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 },
},
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = nodeboxes[node]
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
{ 0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
}, },
groups = {snappy=3}, groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
walkable = true, walkable = true,
stack_max = 99,
drop = "pipeworks:horizontal"
}) })
end
minetest.register_node("pipeworks:junction_xz_loaded", { print("Pipeworks loaded!")
description = "Pipe (junction between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.15, -0.15, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xy_down_loaded", {
description = "Pipe (downward bend between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.5, 0.15, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.1 , 0.1 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xy_up_loaded", {
description = "Pipe (upward bend between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.15, -0.15, 0.5, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, 0.45 , -0.15, 0.15, 0.5, 0.15 },
{ -0.1 , -0.1 , -0.1 , 0.1 , 0.45, 0.1 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:bend_xz_loaded", {
description = "Pipe (bend between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png",
"pipeworks_pipe_end.png",
"pipeworks_plain.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.15, -0.15, -0.15, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xz_loaded", {
description = "Pipe (4-way crossing between X/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"
},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.15, -0.5, 0.5, 0.15, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xy_loaded", {
description = "Pipe (4-way crossing between X/Y axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_windowed_loaded.png",
"pipeworks_windowed_loaded.png"
},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.15, 0.5, 0.5, 0.15 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("pipeworks:crossing_xyz_loaded", {
description = "Pipe (6-way crossing between X/Y/Z axes)",
drawtype = "nodebox",
tile_images = { "pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png",
"pipeworks_pipe_end.png"
},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
},
node_box = {
type = "fixed",
fixed = {
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
}
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
print("[Pipeworks] Loaded!")