summaryrefslogtreecommitdiff
path: root/vacuum_tubes.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-31 16:10:25 +0100
committerTim <t4im@users.noreply.github.com>2015-01-31 16:10:25 +0100
commite60f86a5886f41636f6f189ce09a5097a9baabee (patch)
tree6e9e29ac71fa675c02f0c4798c0b8f626495a884 /vacuum_tubes.lua
parent810ae99008667209508f553e6b08e53e63bf1029 (diff)
downloadpipeworks-e60f86a5886f41636f6f189ce09a5097a9baabee.tar
pipeworks-e60f86a5886f41636f6f189ce09a5097a9baabee.tar.gz
pipeworks-e60f86a5886f41636f6f189ce09a5097a9baabee.tar.bz2
pipeworks-e60f86a5886f41636f6f189ce09a5097a9baabee.tar.xz
pipeworks-e60f86a5886f41636f6f189ce09a5097a9baabee.zip
switch to the minetest-conventional def-table style of registering tubes to clean up their registrations
fallback for the old call is provided
Diffstat (limited to 'vacuum_tubes.lua')
-rw-r--r--vacuum_tubes.lua37
1 files changed, 19 insertions, 18 deletions
diff --git a/vacuum_tubes.lua b/vacuum_tubes.lua
index 2e6dc81..2dc7425 100644
--- a/vacuum_tubes.lua
+++ b/vacuum_tubes.lua
@@ -1,13 +1,13 @@
if pipeworks.enable_sand_tube then
- local sand_noctr_textures = { "pipeworks_sand_tube_noctr.png" }
- local sand_plain_textures = { "pipeworks_sand_tube_plain.png" }
- local sand_end_textures = { "pipeworks_sand_tube_end.png" }
- local sand_short_texture = "pipeworks_sand_tube_short.png"
- local sand_inv_texture = "pipeworks_sand_tube_inv.png"
-
- pipeworks.register_tube("pipeworks:sand_tube", "Vacuuming Pneumatic Tube Segment", sand_plain_textures, sand_noctr_textures, sand_end_textures,
- sand_short_texture, sand_inv_texture,
- {groups = {vacuum_tube = 1}})
+ pipeworks.register_tube("pipeworks:sand_tube", {
+ description = "Vacuuming Pneumatic Tube Segment",
+ inventory_image = "pipeworks_sand_tube_inv.png",
+ short = "pipeworks_sand_tube_short.png",
+ noctr = { "pipeworks_sand_tube_noctr.png" },
+ plain = { "pipeworks_sand_tube_plain.png" },
+ ends = { "pipeworks_sand_tube_end.png" },
+ node_def = { groups = {vacuum_tube = 1}},
+ })
minetest.register_craft( {
output = "pipeworks:sand_tube_1 2",
@@ -36,15 +36,15 @@ if pipeworks.enable_sand_tube then
end
if pipeworks.enable_mese_sand_tube then
- local mese_sand_noctr_textures = { "pipeworks_mese_sand_tube_noctr.png" }
- local mese_sand_plain_textures = { "pipeworks_mese_sand_tube_plain.png" }
- local mese_sand_end_textures = { "pipeworks_mese_sand_tube_end.png" }
- local mese_sand_short_texture = "pipeworks_mese_sand_tube_short.png"
- local mese_sand_inv_texture = "pipeworks_mese_sand_tube_inv.png"
-
- pipeworks.register_tube("pipeworks:mese_sand_tube", "Adjustable Vacuuming Pneumatic Tube Segment", mese_sand_plain_textures, mese_sand_noctr_textures,
- mese_sand_end_textures, mese_sand_short_texture,mese_sand_inv_texture,
- {groups = {vacuum_tube = 1},
+ pipeworks.register_tube("pipeworks:mese_sand_tube", {
+ description = "Adjustable Vacuuming Pneumatic Tube Segment",
+ inventory_image = "pipeworks_mese_sand_tube_inv.png",
+ short = "pipeworks_mese_sand_tube_short.png",
+ noctr = { "pipeworks_mese_sand_tube_noctr.png" },
+ plain = { "pipeworks_mese_sand_tube_plain.png" },
+ ends = { "pipeworks_mese_sand_tube_end.png" },
+ node_def = {
+ groups = {vacuum_tube = 1},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("dist", 0)
@@ -63,6 +63,7 @@ if pipeworks.enable_mese_sand_tube then
meta:set_string("infotext", ("Adjustable Vacuuming Pneumatic Tube Segment (%dm)"):format(dist))
end
end,
+ },
})
minetest.register_craft( {