forked from mtcontrib/pipeworks
rewrote pipeworks to use loops and tables to create the nodes. Requires far
less code now.
This commit is contained in:
parent
b3765b0df6
commit
151b7f023f
826
init.lua
826
init.lua
@ -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",
|
||||||
"pipeworks_pipe_end.png",
|
"junction between X and Z axes",
|
||||||
"pipeworks_plain.png",
|
"downward bend between X and Y axes",
|
||||||
"pipeworks_plain.png",
|
"upward bend between X and Y axes",
|
||||||
"pipeworks_windowed_empty.png",
|
"bend between X/Z axes",
|
||||||
"pipeworks_windowed_empty.png"
|
"4-way crossing between X and Z axes",
|
||||||
},
|
"4-way crossing between X/Z and Y axes",
|
||||||
paramtype = "light",
|
"6-way crossing"
|
||||||
-- 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", {
|
local nodeimages = {
|
||||||
description = "Pipe (horizontal)",
|
{"pipeworks_pipe_end.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_windowed_empty.png",
|
"pipeworks_plain.png",
|
||||||
"pipeworks_windowed_empty.png",
|
"pipeworks_plain.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_windowed_XXXXX.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.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", {
|
{"pipeworks_windowed_XXXXX.png",
|
||||||
description = "Pipe (junction between X/Y axes)",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_pipe_end.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_plain.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_plain.png"},
|
||||||
"pipeworks_plain.png",
|
|
||||||
"pipeworks_windowed_empty.png",
|
|
||||||
"pipeworks_windowed_empty.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{"pipeworks_pipe_end.png",
|
||||||
paramtype2 = "facedir",
|
"pipeworks_pipe_end.png",
|
||||||
selection_box = {
|
"pipeworks_pipe_end.png",
|
||||||
type = "fixed",
|
"pipeworks_plain.png",
|
||||||
fixed = { -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 },
|
"pipeworks_windowed_XXXXX.png",
|
||||||
},
|
"pipeworks_windowed_XXXXX.png"},
|
||||||
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.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:junction_xz", {
|
{"pipeworks_windowed_XXXXX.png",
|
||||||
description = "Pipe (junction between X/Z axes)",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_windowed_empty.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_windowed_empty.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_plain.png"},
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_plain.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{"pipeworks_plain.png",
|
||||||
paramtype2 = "facedir",
|
"pipeworks_pipe_end.png",
|
||||||
selection_box = {
|
"pipeworks_pipe_end.png",
|
||||||
type = "fixed",
|
"pipeworks_plain.png",
|
||||||
fixed = { -0.5, -0.15, -0.15, 0.5, 0.15, 0.5 },
|
"pipeworks_windowed_XXXXX.png",
|
||||||
},
|
"pipeworks_windowed_XXXXX.png"},
|
||||||
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", {
|
{"pipeworks_pipe_end.png",
|
||||||
description = "Pipe (downward bend between X/Y axes)",
|
"pipeworks_plain.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_plain.png",
|
"pipeworks_plain.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_windowed_XXXXX.png"},
|
||||||
"pipeworks_plain.png",
|
|
||||||
"pipeworks_windowed_empty.png",
|
|
||||||
"pipeworks_windowed_empty.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{"pipeworks_windowed_XXXXX.png",
|
||||||
paramtype2 = "facedir",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
selection_box = {
|
"pipeworks_pipe_end.png",
|
||||||
type = "fixed",
|
"pipeworks_plain.png",
|
||||||
fixed = { -0.15, -0.5, -0.15, 0.5, 0.15, 0.15 },
|
"pipeworks_pipe_end.png",
|
||||||
},
|
"pipeworks_plain.png"},
|
||||||
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", {
|
{"pipeworks_windowed_XXXXX.png",
|
||||||
description = "Pipe (upward bend between X/Y axes)",
|
"pipeworks_windowed_XXXXX.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_pipe_end.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_plain.png",
|
"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",
|
{"pipeworks_pipe_end.png",
|
||||||
paramtype2 = "facedir",
|
"pipeworks_pipe_end.png",
|
||||||
selection_box = {
|
"pipeworks_pipe_end.png",
|
||||||
type = "fixed",
|
"pipeworks_pipe_end.png",
|
||||||
fixed = { -0.15, -0.15, -0.15, 0.5, 0.5, 0.15 },
|
"pipeworks_windowed_XXXXX.png",
|
||||||
},
|
"pipeworks_windowed_XXXXX.png"},
|
||||||
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", {
|
{"pipeworks_pipe_end.png",
|
||||||
description = "Pipe (bend between X/Z axes)",
|
"pipeworks_pipe_end.png",
|
||||||
drawtype = "nodebox",
|
"pipeworks_pipe_end.png",
|
||||||
tile_images = { "pipeworks_windowed_empty.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_windowed_empty.png",
|
"pipeworks_pipe_end.png",
|
||||||
"pipeworks_pipe_end.png",
|
"pipeworks_pipe_end.png"}
|
||||||
"pipeworks_plain.png",
|
}
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_plain.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
local selectionboxes = {
|
||||||
paramtype2 = "facedir",
|
{ -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, -- vertical
|
||||||
selection_box = {
|
{ -0.5, -0.15, -0.15, 0.5, 0.15, 0.15 }, -- horizontal
|
||||||
type = "fixed",
|
{ -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 }, -- vertical with X/Z junction
|
||||||
fixed = { -0.15, -0.15, -0.15, 0.5, 0.15, 0.5 },
|
{ -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
|
||||||
node_box = {
|
{ -0.15, -0.15, -0.15, 0.5, 0.5, 0.15 }, -- bend up from X/Z to Y axis
|
||||||
type = "fixed",
|
{ -0.15, -0.15, -0.15, 0.5, 0.15, 0.5 }, -- bend between X and Z axes
|
||||||
fixed = {
|
{ -0.5, -0.15, -0.5, 0.5, 0.15, 0.5 }, -- 4-way crossing between X and Z axes
|
||||||
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
|
{ -0.5, -0.5, -0.15, 0.5, 0.5, 0.15 }, -- 4-way crossing between X/Z and Y axes
|
||||||
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
|
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, -- 6-way crossing (all 3 axes)
|
||||||
{ -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", {
|
local nodeboxes = {
|
||||||
description = "Pipe (4-way crossing between X/Z axes)",
|
{{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- vertical
|
||||||
drawtype = "nodebox",
|
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
|
||||||
tile_images = { "pipeworks_windowed_empty.png",
|
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 }},
|
||||||
"pipeworks_windowed_empty.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- horizontal
|
||||||
selection_box = {
|
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
type = "fixed",
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
|
||||||
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.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- vertical with X/Z junction
|
||||||
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
|
||||||
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 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.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.45, 0.15, 0.15, 0.5 }, -- horizontal with X/Z junction
|
||||||
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
|
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
|
||||||
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
|
{ -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_xy", {
|
{{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- bend down from X/Z to Y axis
|
||||||
description = "Pipe (4-way crossing between X/Y axes)",
|
{ -0.1 , -0.45, -0.1 , 0.1 , 0.1 , 0.1 },
|
||||||
drawtype = "nodebox",
|
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
tile_images = { "pipeworks_pipe_end.png",
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_windowed_empty.png",
|
|
||||||
"pipeworks_windowed_empty.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{{ -0.15, 0.45 , -0.15, 0.15, 0.5, 0.15 }, -- bend up from X/Z to Y axis
|
||||||
paramtype2 = "facedir",
|
{ -0.1 , -0.1 , -0.1 , 0.1 , 0.45, 0.1 },
|
||||||
selection_box = {
|
{ -0.1 , -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
type = "fixed",
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
|
||||||
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.15, -0.15, 0.45, 0.15, 0.15, 0.5 }, -- bend between X and Z axes
|
||||||
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
{ -0.1 , -0.1 , 0.1 , 0.1 , 0.1 , 0.45 },
|
||||||
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 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 }},
|
||||||
|
|
||||||
}
|
{{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- 4-way crossing between X and Z axes
|
||||||
},
|
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
groups = {snappy=3},
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
|
||||||
sounds = default.node_sound_wood_defaults(),
|
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
|
||||||
walkable = true,
|
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
|
||||||
})
|
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 }},
|
||||||
|
|
||||||
minetest.register_node("pipeworks:crossing_xyz", {
|
{{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 }, -- 4-way crossing between X/Z and Y axes
|
||||||
description = "Pipe (6-way crossing between X/Y/Z axes)",
|
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
|
||||||
drawtype = "nodebox",
|
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
|
||||||
tile_images = { "pipeworks_pipe_end.png",
|
{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 },
|
||||||
"pipeworks_pipe_end.png",
|
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
"pipeworks_pipe_end.png",
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 }},
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png",
|
|
||||||
"pipeworks_pipe_end.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
paramtype = "light",
|
{{ -0.5 , -0.15, -0.15, -0.45, 0.15, 0.15 }, -- 6-way crossing (all 3 axes)
|
||||||
selection_box = {
|
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
||||||
type = "fixed",
|
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
|
||||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
|
||||||
},
|
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
|
||||||
node_box = {
|
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
|
||||||
type = "fixed",
|
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
|
||||||
fixed = {
|
{ -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 },
|
function fix_image_names(node, replacement)
|
||||||
{ -0.45, -0.1 , -0.1 , 0.45, 0.1 , 0.1 },
|
outtable={}
|
||||||
{ 0.45, -0.15, -0.15, 0.5 , 0.15, 0.15 },
|
for i in ipairs(nodeimages[node]) do
|
||||||
|
print(nodeimages[node][i])
|
||||||
|
outtable[i]=string.gsub(nodeimages[node][i], "_XXXXX", replacement)
|
||||||
|
print(outtable[i])
|
||||||
|
end
|
||||||
|
|
||||||
{ -0.15, -0.15, -0.5 , 0.15, 0.15, -0.45 },
|
return outtable
|
||||||
{ -0.1 , -0.1 , -0.45, 0.1 , 0.1 , 0.45 },
|
end
|
||||||
{ -0.15, -0.15, 0.45, 0.15, 0.15, 0.5 },
|
|
||||||
|
|
||||||
{ -0.15, -0.5 , -0.15, 0.15, -0.45, 0.15 },
|
-- Now define the actual nodes
|
||||||
{ -0.1 , -0.45, -0.1 , 0.1 , 0.45, 0.1 },
|
|
||||||
{ -0.15, 0.45, -0.15, 0.15, 0.5 , 0.15 },
|
|
||||||
|
|
||||||
}
|
for node in ipairs(nodenames) do
|
||||||
},
|
minetest.register_node("pipeworks:"..nodenames[node], {
|
||||||
groups = {snappy=3},
|
description = "Empty Pipe ("..descriptions[node]..")",
|
||||||
sounds = default.node_sound_wood_defaults(),
|
drawtype = "nodebox",
|
||||||
walkable = true,
|
tiles = fix_image_names(node, "_empty"),
|
||||||
})
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
selection_box = selectionboxes[node],
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = nodeboxes[node]
|
||||||
|
},
|
||||||
|
groups = {snappy=3, pipe=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
walkable = true,
|
||||||
|
stack_max = 99,
|
||||||
|
drop = "pipeworks:horizontal"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("pipeworks:"..nodenames[node].."_loaded", {
|
||||||
|
description = "Loaded Pipe ("..descriptions[node]..")",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = fix_image_names(node, "_loaded"),
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
selection_box = selectionboxes[node],
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = nodeboxes[node]
|
||||||
|
},
|
||||||
|
groups = {snappy=3, pipe=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
walkable = true,
|
||||||
|
stack_max = 99,
|
||||||
|
drop = "pipeworks:horizontal"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- Nodes (full/loaded)
|
print("Pipeworks 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",
|
|
||||||
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.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_loaded", {
|
|
||||||
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_loaded.png",
|
|
||||||
"pipeworks_windowed_loaded.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.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},
|
|
||||||
sounds = default.node_sound_wood_defaults(),
|
|
||||||
walkable = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("pipeworks:junction_xz_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!")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user