mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-06-29 23:00:49 +02:00
switch to the minetest-conventional def-table style of registering tubes to clean up their registrations
fallback for the old call is provided
This commit is contained in:
@ -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 = {
|
||||
|
Reference in New Issue
Block a user