diff options
author | Tim <t4im@users.noreply.github.com> | 2015-01-31 16:10:25 +0100 |
---|---|---|
committer | Tim <t4im@users.noreply.github.com> | 2015-01-31 16:10:25 +0100 |
commit | e60f86a5886f41636f6f189ce09a5097a9baabee (patch) | |
tree | 6e9e29ac71fa675c02f0c4798c0b8f626495a884 /routing_tubes.lua | |
parent | 810ae99008667209508f553e6b08e53e63bf1029 (diff) |
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 'routing_tubes.lua')
-rw-r--r-- | routing_tubes.lua | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/routing_tubes.lua b/routing_tubes.lua index 2610119..cb0f8e7 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -10,20 +10,20 @@ minetest.register_craft( { }) if pipeworks.enable_accelerator_tube then - local accelerator_noctr_textures = { "pipeworks_accelerator_tube_noctr.png" } - local accelerator_plain_textures = { "pipeworks_accelerator_tube_plain.png" } - local accelerator_end_textures = { "pipeworks_accelerator_tube_end.png" } - local accelerator_short_texture = "pipeworks_accelerator_tube_short.png" - local accelerator_inv_texture = "pipeworks_accelerator_tube_inv.png" - - pipeworks.register_tube("pipeworks:accelerator_tube", "Accelerating Pneumatic Tube Segment", accelerator_plain_textures, - accelerator_noctr_textures, accelerator_end_textures, accelerator_short_texture, accelerator_inv_texture, - {tube = {can_go = function(pos, node, velocity, stack) + 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) velocity.speed = velocity.speed+1 return pipeworks.notvel(pipeworks.meseadjlist, velocity) end} + }, }) - minetest.register_craft( { output = "pipeworks:accelerator_tube_1 2", recipe = { @@ -32,23 +32,20 @@ if pipeworks.enable_accelerator_tube then { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) - end if pipeworks.enable_crossing_tube then - local crossing_noctr_textures = { "pipeworks_crossing_tube_noctr.png" } - local crossing_plain_textures = { "pipeworks_crossing_tube_plain.png" } - local crossing_end_textures = { "pipeworks_crossing_tube_end.png" } - local crossing_short_texture = "pipeworks_crossing_tube_short.png" - local crossing_inv_texture = "pipeworks_crossing_tube_inv.png" - - pipeworks.register_tube("pipeworks:crossing_tube", "Crossing Pneumatic Tube Segment", crossing_plain_textures, - crossing_noctr_textures, crossing_end_textures, crossing_short_texture, crossing_inv_texture, - {tube = {can_go = function(pos, node, velocity, stack) - return {velocity} - end} + 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 } + }, }) - minetest.register_craft( { output = "pipeworks:crossing_tube_1 5", recipe = { |