make pipeworks Game agnostic (#16)

* make it boot in non mtg

* make water flow

* fix water texture warnings

* fix missing steel texture issues

* remove depreciated/unnessary default function calls

* make sounds work

* fix default formspec crashes

* fix wierd tab spacing

* additionally game dig group support

* move crafts to crafts.lua

* make crafts support various games
This commit is contained in:
wsor4035 2022-03-14 21:39:58 -04:00 committed by GitHub
parent 5618003be3
commit 5aa0501872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 466 additions and 328 deletions

@ -179,10 +179,6 @@ local function update_meta(meta, enabled)
"image_button[3,2;1,0.6;pipeworks_button_" .. state .. ".png;" .. state .. ";;;false;pipeworks_button_interm.png]" .. "image_button[3,2;1,0.6;pipeworks_button_" .. state .. ".png;" .. state .. ";;;false;pipeworks_button_interm.png]" ..
"list[context;src;0,4.5;8,3;]".. "list[context;src;0,4.5;8,3;]"..
"list[context;dst;4,0;4,3;]".. "list[context;dst;4,0;4,3;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0,8) ..
"list[current_player;main;0,8;8,4;]" .. "list[current_player;main;0,8;8,4;]" ..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[context;src]" .. "listring[context;src]" ..
@ -252,7 +248,7 @@ minetest.register_node("pipeworks:autocrafter", {
description = S("Autocrafter"), description = S("Autocrafter"),
drawtype = "normal", drawtype = "normal",
tiles = {"pipeworks_autocrafter.png"}, tiles = {"pipeworks_autocrafter.png"},
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 1},
tube = {insert_object = function(pos, node, stack, direction) tube = {insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -428,12 +424,3 @@ minetest.register_node("pipeworks:autocrafter", {
}, },
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:autocrafter" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:autocrafter"
minetest.register_craft( {
output = "pipeworks:autocrafter 2",
recipe = {
{ "default:steel_ingot", "default:mese_crystal", "default:steel_ingot" },
{ "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "default:mese_crystal", "default:steel_ingot" }
},
})

@ -183,7 +183,7 @@ function pipeworks.create_fake_player(def, is_dynamic)
is_player = delay(true), is_player = delay(true),
is_fake_player = true, is_fake_player = true,
_formspec = def.formspec or default.gui_survival_form, _formspec = def.formspec or "",
_hp = def.hp or 20, _hp = def.hp or 20,
_breath = 11, _breath = 11,
_pos = def.position and table.copy(def.position) or vector.new(), _pos = def.position and table.copy(def.position) or vector.new(),

@ -1,87 +1,348 @@
local materials = {
stone = "default:stone",
desert_stone = "default:desert_stone",
desert_sand = "default:desert_sand",
chest = "default:chest",
copper_ingot = "default:copper_ingot",
steel_ingot = "default:steel_ingot",
gold_ingot = "default:gold_ingot",
mese = "default:mese",
mese_crystal = "default:mese_crystal",
mese_crystal_fragment = "default:mese_crystal_fragment",
glass = "default:glass",
}
if minetest.get_modpath("mcl_core") then
materials = {
stone = "mcl_core:stone",
desert_stone = "mcl_core:sandstone2",
desert_sand = "mcl_core:sand",
chest = "mcl_chests:chest_small",
steel_ingot = "mcl_core:iron_ingot",
gold_ingot = "mcl_core:gold_ingot",
mese = "default:mese",
mese_crystal = "default:mese_crystal",
mese_crystal_fragment = "mesecons:redstone",
-- Use iron where no equivalent
copper_ingot = "mcl_core:iron_ingot",
glass = "default:glass",
}
elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then
materials = {
stone = "fl_stone:stone",
desert_stone = "fl_stone:desert_stone",
desert_sand = "fl_stone:desert_sand",
chest = "fl_storage:wood_chest",
steel_ingot = "fl_ores:iron_ingot",
gold_ingot = "fl_ores:gold_ingot",
mese = "fl_ores:iron_ingot",
mese_crystal = "fl_ores:iron_ingot",
mese_crystal_fragment = "fl_ores:iron_ingot",
copper_ingot = "fl_ores:copper_ingot",
glass = "fl_glass:framed_glass",
}
elseif minetest.get_modpath("hades_core") then
materials = {
stone = "hades_core:stone",
desert_stone = "hades_core:desert_stone",
desert_sand = "hades_core:desert_sand",
chest = "hades_core:chest";
steel_ingot = "hades_core:steel_ingot",
gold_ingot = "hades_core:gold_ingot",
mese = "hades_core:mese",
mese_crystal = "hades_core:mese_crystal",
mese_crystal_fragment = "hades_core:mese_crystal_fragment",
copper_ingot = "hades_core:copper_ingot",
tin_ingot = "hades_core:tin_ingot",
glass = "default:glass",
}
end
-- Crafting recipes for pipes -- Crafting recipes for pipes
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:pipe_1_empty 12", output = "pipeworks:pipe_1_empty 12",
recipe = { recipe = {
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot },
{ "", "", "" }, { "", "", "" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:straight_pipe_empty 3", output = "pipeworks:straight_pipe_empty 3",
recipe = { recipe = {
{ "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty" }, { "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty" },
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:spigot 3", output = "pipeworks:spigot 3",
recipe = { recipe = {
{ "pipeworks:pipe_1_empty", "" }, { "pipeworks:pipe_1_empty", "" },
{ "", "pipeworks:pipe_1_empty" }, { "", "pipeworks:pipe_1_empty" },
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:entry_panel_empty 2", output = "pipeworks:entry_panel_empty 2",
recipe = { recipe = {
{ "", "default:steel_ingot", "" }, { "", materials.steel_ingot, "" },
{ "", "pipeworks:pipe_1_empty", "" }, { "", "pipeworks:pipe_1_empty", "" },
{ "", "default:steel_ingot", "" }, { "", materials.steel_ingot, "" },
}, },
}) })
-- Various ancillary pipe devices -- Various ancillary pipe devices
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:pump_off 2", output = "pipeworks:pump_off 2",
recipe = { recipe = {
{ "default:stone", "default:steel_ingot", "default:stone" }, { materials.stone, materials.steel_ingot, materials.stone },
{ "default:copper_ingot", "default:mese_crystal_fragment", "default:copper_ingot" }, { materials.copper_ingot, materials.mese_crystal_fragment, materials.copper_ingot },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:valve_off_empty 2", output = "pipeworks:valve_off_empty 2",
recipe = { recipe = {
{ "", "group:stick", "" }, { "", "group:stick", "" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot },
{ "", "default:steel_ingot", "" } { "", materials.steel_ingot, "" }
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:storage_tank_0 2", output = "pipeworks:storage_tank_0 2",
recipe = { recipe = {
{ "", "default:steel_ingot", "default:steel_ingot" }, { "", materials.steel_ingot, materials.steel_ingot },
{ "default:steel_ingot", "default:glass", "default:steel_ingot" }, { materials.steel_ingot, materials.glass, materials.steel_ingot },
{ "default:steel_ingot", "default:steel_ingot", "" } { materials.steel_ingot, materials.steel_ingot, "" }
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:grating 2", output = "pipeworks:grating 2",
recipe = { recipe = {
{ "default:steel_ingot", "", "default:steel_ingot" }, { materials.steel_ingot, "", materials.steel_ingot },
{ "", "pipeworks:pipe_1_empty", "" }, { "", "pipeworks:pipe_1_empty", "" },
{ "default:steel_ingot", "", "default:steel_ingot" } { materials.steel_ingot, "", materials.steel_ingot }
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:flow_sensor_empty 2", output = "pipeworks:flow_sensor_empty 2",
recipe = { recipe = {
{ "pipeworks:pipe_1_empty", "mesecons:mesecon", "pipeworks:pipe_1_empty" }, { "pipeworks:pipe_1_empty", "mesecons:mesecon", "pipeworks:pipe_1_empty" },
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
output = "pipeworks:fountainhead 2", output = "pipeworks:fountainhead 2",
recipe = { recipe = {
{ "pipeworks:pipe_1_empty" }, { "pipeworks:pipe_1_empty" },
{ "pipeworks:pipe_1_empty" } { "pipeworks:pipe_1_empty" }
}, },
}) })
-- injectors
minetest.register_craft( {
output = "pipeworks:filter 2",
recipe = {
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" },
{ "group:stick", materials.mese_crystal, "basic_materials:plastic_sheet" },
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
output = "pipeworks:mese_filter 2",
recipe = {
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" },
{ "group:stick", materials.mese, "basic_materials:plastic_sheet" },
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" }
},
})
if minetest.get_modpath("digilines") then
minetest.register_craft( {
output = "pipeworks:digiline_filter 2",
recipe = {
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" },
{ "group:stick", "digilines:wire_std_00000000", "basic_materials:plastic_sheet" },
{ materials.steel_ingot, materials.steel_ingot, "basic_materials:plastic_sheet" }
},
})
end
-- other
minetest.register_craft( {
output = "pipeworks:autocrafter 2",
recipe = {
{ materials.steel_ingot, materials.mese_crystal, materials.steel_ingot },
{ "basic_materials:plastic_sheet", materials.steel_ingot, "basic_materials:plastic_sheet" },
{ materials.steel_ingot, materials.mese_crystal, materials.steel_ingot }
},
})
minetest.register_craft( {
output = "pipeworks:steel_block_embedded_tube 1",
recipe = {
{ materials.steel_ingot, materials.steel_ingot, materials.steel_ingot },
{ materials.steel_ingot, "pipeworks:tube_1", materials.steel_ingot },
{ materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }
},
})
minetest.register_craft( {
output = "pipeworks:steel_pane_embedded_tube 1",
recipe = {
{ "", materials.steel_ingot, "" },
{ "", "pipeworks:tube_1", "" },
{ "", materials.steel_ingot, "" }
},
})
minetest.register_craft({
output = "pipeworks:trashcan",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ materials.steel_ingot, "", materials.steel_ingot },
{ materials.steel_ingot, materials.steel_ingot, materials.steel_ingot },
},
})
minetest.register_craft( {
output = "pipeworks:teleport_tube_1 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ materials.desert_stone, materials.mese, materials.desert_stone },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
if pipeworks.enable_priority_tube then
minetest.register_craft( {
output = "pipeworks:priority_tube_1 6",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ materials.gold_ingot, "", materials.gold_ingot },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end
if pipeworks.enable_accelerator_tube then
minetest.register_craft( {
output = "pipeworks:accelerator_tube_1 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ materials.mese_crystal_fragment, materials.steel_ingot, materials.mese_crystal_fragment },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end
if pipeworks.enable_crossing_tube then
minetest.register_craft( {
output = "pipeworks:crossing_tube_1 5",
recipe = {
{ "", "pipeworks:tube_1", "" },
{ "pipeworks:tube_1", "pipeworks:tube_1", "pipeworks:tube_1" },
{ "", "pipeworks:tube_1", "" }
},
})
end
if pipeworks.enable_one_way_tube then
minetest.register_craft({
output = "pipeworks:one_way_tube 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "group:stick", materials.mese_crystal, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end
if pipeworks.enable_mese_tube then
minetest.register_craft( {
output = "pipeworks:mese_tube_000000 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "", materials.mese_crystal, "" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "pipeworks:mese_tube_000000",
recipe = {
"pipeworks:tube_1",
materials.mese_crystal,
materials.mese_crystal,
materials.mese_crystal,
materials.mese_crystal,
},
})
end
if pipeworks.enable_mese_sand_tube then
minetest.register_craft( {
output = "pipeworks:mese_sand_tube_1 2",
recipe = {
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{"group:sand", materials.mese_crystal, "group:sand" },
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "pipeworks:mese_sand_tube_1",
recipe = {
"pipeworks:sand_tube_1",
materials.mese_crystal_fragment,
materials.mese_crystal_fragment,
materials.mese_crystal_fragment,
materials.mese_crystal_fragment,
},
})
end
if pipeworks.enable_deployer then
minetest.register_craft({
output = "pipeworks:deployer_off",
recipe = {
{ "group:wood", "default:chest", "group:wood" },
{ materials.stone, "mesecons:piston", materials.stone },
{ materials.stone, "mesecons:mesecon", materials.stone },
}
})
end
if pipeworks.enable_dispenser then
minetest.register_craft({
output = "pipeworks:dispenser_off",
recipe = {
{ materials.desert_sand, materials.chest, materials.desert_sand },
{ materials.stone, "mesecons:piston", materials.stone },
{ materials.stone, "mesecons:mesecon", materials.stone },
}
})
end
if pipeworks.enable_node_breaker then
minetest.register_craft({
output = "pipeworks:nodebreaker_off",
recipe = {
{ "basic_materials:gear_steel", "basic_materials:gear_steel", "basic_materials:gear_steel" },
{ materials.stone, "mesecons:piston", materials.stone },
{ "group:wood", "mesecons:mesecon", "group:wood" },
}
})
end

@ -1,20 +1,24 @@
local S = minetest.get_translator("pipeworks") local S = minetest.get_translator("pipeworks")
local straight = function(pos, node, velocity, stack) return {velocity} end local straight = function(pos, node, velocity, stack) return {velocity} end
local steel_tex = "[combine:16x16^[noalpha^[colorize:#D3D3D3"
if minetest.get_modpath("default") then steel_tex = "default_steel_block.png" end
minetest.register_node("pipeworks:steel_block_embedded_tube", { minetest.register_node("pipeworks:steel_block_embedded_tube", {
description = S("Airtight steelblock embedded tube"), description = S("Airtight steelblock embedded tube"),
tiles = { tiles = {
"default_steel_block.png", "default_steel_block.png", steel_tex, steel_tex,
"default_steel_block.png", "default_steel_block.png", steel_tex, steel_tex,
"default_steel_block.png^pipeworks_tube_connection_metallic.png", steel_tex .. "^pipeworks_tube_connection_metallic.png",
"default_steel_block.png^pipeworks_tube_connection_metallic.png", steel_tex .. "^pipeworks_tube_connection_metallic.png",
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2},
legacy_facedir_simple = true, legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(), _sound_def = {
key = "node_sound_stone_defaults",
},
tube = { tube = {
connect_sides = {front = 1, back = 1,}, connect_sides = {front = 1, back = 1,},
priority = 50, priority = 50,
@ -30,15 +34,6 @@ minetest.register_node("pipeworks:steel_block_embedded_tube", {
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_block_embedded_tube" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_block_embedded_tube"
minetest.register_craft( {
output = "pipeworks:steel_block_embedded_tube 1",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
{ "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }
},
})
local pane_box = { local pane_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -66,9 +61,11 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", {
collision_box = pane_box, collision_box = pane_box,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2},
legacy_facedir_simple = true, legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(), _sound_def = {
key = "node_sound_stone_defaults",
},
tube = { tube = {
connect_sides = {front = 1, back = 1,}, connect_sides = {front = 1, back = 1,},
priority = 50, priority = 50,
@ -83,12 +80,3 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", {
on_rotate = pipeworks.on_rotate, on_rotate = pipeworks.on_rotate,
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_pane_embedded_tube" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_pane_embedded_tube"
minetest.register_craft( {
output = "pipeworks:steel_pane_embedded_tube 1",
recipe = {
{ "", "default:steel_ingot", "" },
{ "", "pipeworks:tube_1", "" },
{ "", "default:steel_ingot", "" }
},
})

@ -133,9 +133,9 @@ for s in ipairs(states) do
local dgroups local dgroups
if states[s] == "off" then if states[s] == "off" then
dgroups = {snappy=3, pipe=1} dgroups = {snappy=3, pipe=1, dig_generic = 4}
else else
dgroups = {snappy=3, pipe=1, not_in_creative_inventory=1} dgroups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}
end end
local pumpname = "pipeworks:pump_"..states[s] local pumpname = "pipeworks:pump_"..states[s]
@ -148,7 +148,9 @@ for s in ipairs(states) do
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = dgroups, groups = dgroups,
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { top = 1 }, pipe_connections = { top = 1 },
after_place_node = function(pos) after_place_node = function(pos)
@ -170,7 +172,7 @@ for s in ipairs(states) do
local fdir = node.param2 local fdir = node.param2
minetest.swap_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir }) minetest.swap_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir })
end, end,
on_rotate = screwdriver.rotate_simple on_rotate = screwdriver and screwdriver.rotate_simple or nil
}) })
-- FIXME: this currently assumes that pumps can only rotate around the fixed axis pointing Y+. -- FIXME: this currently assumes that pumps can only rotate around the fixed axis pointing Y+.
@ -200,7 +202,9 @@ for s in ipairs(states) do
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 } fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
}, },
groups = dgroups, groups = dgroups,
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -247,8 +251,10 @@ minetest.register_node(nodename_valve_loaded, {
type = "fixed", type = "fixed",
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 } fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
}, },
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -297,8 +303,10 @@ minetest.register_node("pipeworks:grating", {
}, },
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { top = 1 }, pipe_connections = { top = 1 },
after_place_node = function(pos) after_place_node = function(pos)
@ -322,8 +330,10 @@ minetest.register_node(nodename_spigot_empty, {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { left=1, right=1, front=1, back=1, pipe_connections = { left=1, right=1, front=1, back=1,
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 }, left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
@ -350,23 +360,17 @@ minetest.register_node(nodename_spigot_loaded, {
drawtype = "mesh", drawtype = "mesh",
mesh = "pipeworks_spigot_pouring"..polys..".obj", mesh = "pipeworks_spigot_pouring"..polys..".obj",
tiles = { tiles = {
{ minetest.registered_nodes[pipeworks.liquids.water.source].tiles[1],
name = "default_water_flowing_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.8,
},
},
{ name = "pipeworks_spigot.png" } { name = "pipeworks_spigot.png" }
}, },
use_texture_alpha = texture_alpha_mode and "blend" or true, use_texture_alpha = texture_alpha_mode and "blend" or true,
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { left=1, right=1, front=1, back=1, pipe_connections = { left=1, right=1, front=1, back=1,
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 }, left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
@ -421,8 +425,10 @@ minetest.register_node(nodename_panel_empty, {
tiles = { "pipeworks_entry_panel.png" }, tiles = { "pipeworks_entry_panel.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -441,8 +447,10 @@ minetest.register_node(nodename_panel_loaded, {
tiles = { "pipeworks_entry_panel.png" }, tiles = { "pipeworks_entry_panel.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -471,8 +479,10 @@ minetest.register_node(nodename_sensor_empty, {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -510,8 +520,10 @@ minetest.register_node(nodename_sensor_loaded, {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -555,12 +567,12 @@ new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pi
-- TODO flow-logic-stub: these don't currently do anything under the new flow logic. -- TODO flow-logic-stub: these don't currently do anything under the new flow logic.
for fill = 0, 10 do for fill = 0, 10 do
local filldesc=S("empty") local filldesc=S("empty")
local sgroups = {snappy=3, pipe=1, tankfill=fill+1} local sgroups = {snappy=3, pipe=1, tankfill=fill+1, dig_generic = 4}
local image = nil local image = nil
if fill ~= 0 then if fill ~= 0 then
filldesc=S("@1% full", 10*fill) filldesc=S("@1% full", 10*fill)
sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1} sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1, dig_generic = 4}
image = "pipeworks_storage_tank_fittings.png" image = "pipeworks_storage_tank_fittings.png"
end end
@ -577,8 +589,10 @@ for fill = 0, 10 do
inventory_image = image, inventory_image = image,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
drop = "pipeworks:storage_tank_0", drop = "pipeworks:storage_tank_0",
pipe_connections = { top = 1, bottom = 1}, pipe_connections = { top = 1, bottom = 1},
@ -606,7 +620,9 @@ for fill = 0, 10 do
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = sgroups, groups = sgroups,
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
drop = "pipeworks:storage_tank_0", drop = "pipeworks:storage_tank_0",
pipe_connections = { top = 1, bottom = 1}, pipe_connections = { top = 1, bottom = 1},
@ -632,8 +648,10 @@ minetest.register_node(nodename_fountain_empty, {
tiles = { "pipeworks_fountainhead.png" }, tiles = { "pipeworks_fountainhead.png" },
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { bottom = 1 }, pipe_connections = { bottom = 1 },
after_place_node = function(pos) after_place_node = function(pos)
@ -667,8 +685,10 @@ minetest.register_node(nodename_fountain_loaded, {
tiles = { "pipeworks_fountainhead.png" }, tiles = { "pipeworks_fountainhead.png" },
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
pipe_connections = { bottom = 1 }, pipe_connections = { bottom = 1 },
after_place_node = function(pos) after_place_node = function(pos)
@ -717,8 +737,10 @@ minetest.register_node(nodename_sp_empty, {
tiles = { "pipeworks_straight_pipe_empty.png" }, tiles = { "pipeworks_straight_pipe_empty.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1}, groups = {snappy=3, pipe=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)
@ -739,8 +761,10 @@ minetest.register_node(nodename_sp_loaded, {
tiles = { "pipeworks_straight_pipe_loaded.png" }, tiles = { "pipeworks_straight_pipe_loaded.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4},
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
on_place = pipeworks.rotate_on_place, on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos) after_dig_node = function(pos)

@ -377,7 +377,9 @@ for _, data in ipairs({
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2}, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2},
legacy_facedir_simple = true, legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(), _sound_def = {
key = "node_sound_wood_defaults",
},
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
set_filter_formspec(data, meta) set_filter_formspec(data, meta)
@ -482,35 +484,6 @@ for _, data in ipairs({
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:"..data.name pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:"..data.name
end end
minetest.register_craft( {
output = "pipeworks:filter 2",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
{ "group:stick", "default:mese_crystal", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
output = "pipeworks:mese_filter 2",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
{ "group:stick", "default:mese", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
},
})
if minetest.get_modpath("digilines") then
minetest.register_craft( {
output = "pipeworks:digiline_filter 2",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
{ "group:stick", "digilines:wire_std_00000000", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
},
})
end
--[[ --[[
In the past the filter-injectors had real items in their inventories. This code In the past the filter-injectors had real items in their inventories. This code
puts them to the input to the filter-injector if possible. Else the items are puts them to the input to the filter-injector if possible. Else the items are

@ -83,7 +83,7 @@ end
pipeworks.spigot_check = function(pos, node) pipeworks.spigot_check = function(pos, node)
local belowname = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name local belowname = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name
if belowname and (belowname == "air" or belowname == "default:water_flowing" or belowname == "default:water_source") then if belowname and (belowname == "air" or belowname == pipeworks.liquids.water.flowing or belowname == pipeworks.liquids.water.source) then
local spigotname = minetest.get_node(pos).name local spigotname = minetest.get_node(pos).name
local fdir=node.param2 % 4 local fdir=node.param2 % 4
local check = { local check = {
@ -96,14 +96,14 @@ pipeworks.spigot_check = function(pos, node)
if near_node and string.find(near_node.name, "_loaded") then if near_node and string.find(near_node.name, "_loaded") then
if spigotname and spigotname == "pipeworks:spigot" then if spigotname and spigotname == "pipeworks:spigot" then
minetest.add_node(pos,{name = "pipeworks:spigot_pouring", param2 = fdir}) minetest.add_node(pos,{name = "pipeworks:spigot_pouring", param2 = fdir})
if finitewater or belowname ~= "default:water_source" then if finitewater or belowname ~= pipeworks.liquids.water.source then
minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z},{name = "default:water_source"}) minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z},{name = pipeworks.liquids.water.source})
end end
end end
else else
if spigotname == "pipeworks:spigot_pouring" then if spigotname == "pipeworks:spigot_pouring" then
minetest.add_node({x=pos.x,y=pos.y,z=pos.z},{name = "pipeworks:spigot", param2 = fdir}) minetest.add_node({x=pos.x,y=pos.y,z=pos.z},{name = "pipeworks:spigot", param2 = fdir})
if belowname == "default:water_source" and not finitewater then if belowname == pipeworks.liquids.water.source and not finitewater then
minetest.remove_node({x=pos.x,y=pos.y-1,z=pos.z}) minetest.remove_node({x=pos.x,y=pos.y-1,z=pos.z})
end end
end end
@ -113,20 +113,20 @@ end
pipeworks.fountainhead_check = function(pos, node) pipeworks.fountainhead_check = function(pos, node)
local abovename = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name local abovename = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name
if abovename and (abovename == "air" or abovename == "default:water_flowing" or abovename == "default:water_source") then if abovename and (abovename == "air" or abovename == pipeworks.liquids.water.flowing or abovename == pipeworks.liquids.water.source) then
local fountainhead_name = minetest.get_node(pos).name local fountainhead_name = minetest.get_node(pos).name
local near_node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) local near_node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if near_node and string.find(near_node.name, "_loaded") then if near_node and string.find(near_node.name, "_loaded") then
if fountainhead_name and fountainhead_name == "pipeworks:fountainhead" then if fountainhead_name and fountainhead_name == "pipeworks:fountainhead" then
minetest.add_node(pos,{name = "pipeworks:fountainhead_pouring"}) minetest.add_node(pos,{name = "pipeworks:fountainhead_pouring"})
if finitewater or abovename ~= "default:water_source" then if finitewater or abovename ~= pipeworks.liquids.water.source then
minetest.add_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "default:water_source"}) minetest.add_node({x=pos.x,y=pos.y+1,z=pos.z},{name = pipeworks.liquids.water.source})
end end
end end
else else
if fountainhead_name == "pipeworks:fountainhead_pouring" then if fountainhead_name == "pipeworks:fountainhead_pouring" then
minetest.add_node({x=pos.x,y=pos.y,z=pos.z},{name = "pipeworks:fountainhead"}) minetest.add_node({x=pos.x,y=pos.y,z=pos.z},{name = "pipeworks:fountainhead"})
if abovename == "default:water_source" and not finitewater then if abovename == pipeworks.liquids.water.source and not finitewater then
minetest.remove_node({x=pos.x,y=pos.y+1,z=pos.z}) minetest.remove_node({x=pos.x,y=pos.y+1,z=pos.z})
end end
end end

@ -11,6 +11,16 @@ pipeworks.worldpath = minetest.get_worldpath()
pipeworks.modpath = minetest.get_modpath("pipeworks") pipeworks.modpath = minetest.get_modpath("pipeworks")
local S = minetest.get_translator("pipeworks") local S = minetest.get_translator("pipeworks")
pipeworks.liquids = {}
pipeworks.liquids.water = {
source = minetest.registered_nodes["mapgen_water_source"].name,
flowing = minetest.registered_nodes["mapgen_water_source"].liquid_alternative_flowing
}
pipeworks.liquids.river_water = {
source = minetest.registered_nodes["mapgen_river_water_source"].name,
flowing = minetest.registered_nodes["mapgen_river_water_source"].liquid_alternative_flowing
}
dofile(pipeworks.modpath.."/default_settings.lua") dofile(pipeworks.modpath.."/default_settings.lua")
-- Read the external config file if it exists. -- Read the external config file if it exists.
local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt" local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt"
@ -40,7 +50,8 @@ pipeworks.rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y
pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
pipeworks.liquid_texture = "default_water.png" pipeworks.liquid_texture = minetest.registered_nodes[pipeworks.liquids.water.flowing].tiles[1]
if type(pipeworks.liquid_texture) == "table" then pipeworks.liquid_texture = pipeworks.liquid_texture.name end
pipeworks.button_off = {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"} pipeworks.button_off = {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"}
pipeworks.button_on = {text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"} pipeworks.button_on = {text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
@ -113,7 +124,6 @@ dofile(pipeworks.modpath.."/autoplace_tubes.lua")
dofile(pipeworks.modpath.."/luaentity.lua") dofile(pipeworks.modpath.."/luaentity.lua")
dofile(pipeworks.modpath.."/item_transport.lua") dofile(pipeworks.modpath.."/item_transport.lua")
dofile(pipeworks.modpath.."/flowing_logic.lua") dofile(pipeworks.modpath.."/flowing_logic.lua")
dofile(pipeworks.modpath.."/crafts.lua")
dofile(pipeworks.modpath.."/tube_registration.lua") dofile(pipeworks.modpath.."/tube_registration.lua")
dofile(pipeworks.modpath.."/routing_tubes.lua") dofile(pipeworks.modpath.."/routing_tubes.lua")
dofile(pipeworks.modpath.."/sorting_tubes.lua") dofile(pipeworks.modpath.."/sorting_tubes.lua")
@ -137,7 +147,7 @@ dofile(pipeworks.modpath..logicdir.."flowable_node_registry_install.lua")
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
if pipeworks.enable_redefines then if pipeworks.enable_redefines and minetest.get_modpath("default") then
dofile(pipeworks.modpath.."/compat-chests.lua") dofile(pipeworks.modpath.."/compat-chests.lua")
dofile(pipeworks.modpath.."/compat-furnaces.lua") dofile(pipeworks.modpath.."/compat-furnaces.lua")
end end
@ -147,6 +157,8 @@ if pipeworks.enable_lua_tube and
dofile(pipeworks.modpath.."/lua_tube.lua") dofile(pipeworks.modpath.."/lua_tube.lua")
end end
dofile(pipeworks.modpath.."/crafts.lua")
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
-- Unified Inventory categories integration -- Unified Inventory categories integration

@ -27,7 +27,9 @@ if not minetest.get_modpath("auto_tree_tap") and
is_ground_content = true, is_ground_content = true,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, not_in_creative_inventory=1 }, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, not_in_creative_inventory=1 },
sounds = default.node_sound_stone_defaults(), _sound_def = {
key = "node_sound_stone_defaults",
},
tube = {connect_sides={back=1}}, tube = {connect_sides={back=1}},
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

@ -865,7 +865,7 @@ for white = 0, 1 do
tiles[3] = tiles[3]..tiles_on_off.R270:format(white == 1 and "on" or "off"); tiles[3] = tiles[3]..tiles_on_off.R270:format(white == 1 and "on" or "off");
tiles[4] = tiles[4]..tiles_on_off.R_90:format(white == 1 and "on" or "off"); tiles[4] = tiles[4]..tiles_on_off.R_90:format(white == 1 and "on" or "off");
local groups = {snappy = 3, tube = 1, tubedevice = 1, overheat = 1} local groups = {snappy = 3, tube = 1, tubedevice = 1, overheat = 1, dig_generic = 4}
if red + blue + yellow + green + black + white ~= 0 then if red + blue + yellow + green + black + white ~= 0 then
groups.not_in_creative_inventory = 1 groups.not_in_creative_inventory = 1
end end
@ -918,7 +918,9 @@ for white = 0, 1 do
node_box = node_box, node_box = node_box,
on_construct = reset_meta, on_construct = reset_meta,
on_receive_fields = on_receive_fields, on_receive_fields = on_receive_fields,
sounds = default.node_sound_wood_defaults(), _sound_def = {
key = "node_sound_wood_defaults",
},
mesecons = mesecons, mesecons = mesecons,
digiline = digiline, digiline = digiline,
-- Virtual portstates are the ports that -- Virtual portstates are the ports that
@ -1021,14 +1023,16 @@ minetest.register_node(BASENAME .. "_burnt", {
is_burnt = true, is_burnt = true,
paramtype = "light", paramtype = "light",
is_ground_content = false, is_ground_content = false,
groups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory=1}, groups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory=1, dig_generic = 4},
drop = BASENAME.."000000", drop = BASENAME.."000000",
sunlight_propagates = true, sunlight_propagates = true,
selection_box = selection_box, selection_box = selection_box,
node_box = node_box, node_box = node_box,
on_construct = reset_meta, on_construct = reset_meta,
on_receive_fields = on_receive_fields, on_receive_fields = on_receive_fields,
sounds = default.node_sound_wood_defaults(), _sound_def = {
key = "node_sound_wood_defaults",
},
virtual_portstates = {red = false, blue = false, yellow = false, virtual_portstates = {red = false, blue = false, yellow = false,
green = false, black = false, white = false}, green = false, black = false, white = false},
mesecons = { mesecons = {

@ -1,5 +1,5 @@
name = pipeworks name = pipeworks
description = This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them. description = This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them.
depends = default, basic_materials, screwdriver depends = basic_materials
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen, sound_api
min_minetest_version = 5.2.0 min_minetest_version = 5.2.0

@ -37,11 +37,11 @@ for index, connects in ipairs(cconnects) do
end end
--]] --]]
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4}
local pipedesc = S("Pipe Segment").." "..dump(connects) local pipedesc = S("Pipe Segment").." "..dump(connects)
if #connects == 0 then if #connects == 0 then
pgroups = {snappy = 3, tube = 1} pgroups = {snappy = 3, tube = 1, dig_generic = 4}
pipedesc = S("Pipe Segment") pipedesc = S("Pipe Segment")
end end
@ -76,7 +76,9 @@ for index, connects in ipairs(cconnects) do
fixed = outsel fixed = outsel
}, },
groups = pgroups, groups = pgroups,
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
drop = "pipeworks:pipe_1_empty", drop = "pipeworks:pipe_1_empty",
after_place_node = function(pos) after_place_node = function(pos)
@ -91,7 +93,7 @@ for index, connects in ipairs(cconnects) do
pipenumber = index pipenumber = index
}) })
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4}
minetest.register_node("pipeworks:pipe_"..index.."_loaded", { minetest.register_node("pipeworks:pipe_"..index.."_loaded", {
description = pipedesc, description = pipedesc,
@ -110,7 +112,9 @@ for index, connects in ipairs(cconnects) do
fixed = outsel fixed = outsel
}, },
groups = pgroups, groups = pgroups,
sounds = default.node_sound_metal_defaults(), _sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true, walkable = true,
drop = "pipeworks:pipe_1_empty", drop = "pipeworks:pipe_1_empty",
after_place_node = function(pos) after_place_node = function(pos)

@ -42,7 +42,7 @@ local check_for_liquids_v2 = function(pos, limit)
for _, tpos in ipairs(coords) do for _, tpos in ipairs(coords) do
if total >= limit then break end if total >= limit then break end
local name = minetest.get_node(tpos).name local name = minetest.get_node(tpos).name
if name == "default:water_source" then if name == pipeworks.liquids.water.source then
minetest.remove_node(tpos) minetest.remove_node(tpos)
total = total + 1 total = total + 1
end end
@ -247,9 +247,9 @@ flowlogic.helpers.make_neighbour_output_fixed = function(neighbours)
-- in non-finite mode, pressure has to be sustained to keep the sources there. -- in non-finite mode, pressure has to be sustained to keep the sources there.
-- so in non-finite mode, placing water is dependent on the target node; -- so in non-finite mode, placing water is dependent on the target node;
-- draining pressure is not. -- draining pressure is not.
local canplace = (name == "air") or (name == "default:water_flowing") local canplace = (name == "air") or (name == pipeworks.liquids.water.flowing)
if canplace then if canplace then
minetest.swap_node(npos, {name="default:water_source"}) minetest.swap_node(npos, {name=pipeworks.liquids.water.source})
end end
if (not finitemode) or canplace then if (not finitemode) or canplace then
taken = taken + 1 taken = taken + 1
@ -268,7 +268,7 @@ flowlogic.helpers.make_neighbour_cleanup_fixed = function(neighbours)
for _, offset in pairs(neighbours) do for _, offset in pairs(neighbours) do
local npos = vector.add(pos, offset) local npos = vector.add(pos, offset)
local name = minetest.get_node(npos).name local name = minetest.get_node(npos).name
if (name == "default:water_source") then if (name == pipeworks.liquids.water.source) then
--pipeworks.logger("neighbour_cleanup_fixed removing "..formatvec(npos)) --pipeworks.logger("neighbour_cleanup_fixed removing "..formatvec(npos))
minetest.remove_node(npos) minetest.remove_node(npos)
end end

@ -106,14 +106,6 @@ if pipeworks.enable_priority_tube then
tube = { priority = 150 } -- higher than tubedevices (100) tube = { priority = 150 } -- higher than tubedevices (100)
}, },
}) })
minetest.register_craft( {
output = "pipeworks:priority_tube_1 6",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:gold_ingot", "", "default:gold_ingot" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end end
if pipeworks.enable_accelerator_tube then if pipeworks.enable_accelerator_tube then
@ -131,14 +123,6 @@ if pipeworks.enable_accelerator_tube then
end} end}
}, },
}) })
minetest.register_craft( {
output = "pipeworks:accelerator_tube_1 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end end
if pipeworks.enable_crossing_tube then if pipeworks.enable_crossing_tube then
@ -153,14 +137,6 @@ if pipeworks.enable_crossing_tube then
tube = {can_go = function(pos, node, velocity, stack) return {velocity} end } tube = {can_go = function(pos, node, velocity, stack) return {velocity} end }
}, },
}) })
minetest.register_craft( {
output = "pipeworks:crossing_tube_1 5",
recipe = {
{ "", "pipeworks:tube_1", "" },
{ "pipeworks:tube_1", "pipeworks:tube_1", "pipeworks:tube_1" },
{ "", "pipeworks:tube_1", "" }
},
})
end end
local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes
@ -178,7 +154,9 @@ if pipeworks.enable_one_way_tube then
node_box = {type = "fixed", node_box = {type = "fixed",
fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}},
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1}, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1},
sounds = default.node_sound_wood_defaults(), _sound_def = {
key = "node_sound_wood_defaults",
},
tube = { tube = {
connect_sides = {left = 1, right = 1}, connect_sides = {left = 1, right = 1},
can_go = function(pos, node, velocity, stack) can_go = function(pos, node, velocity, stack)
@ -197,12 +175,4 @@ if pipeworks.enable_one_way_tube then
check_for_horiz_pole = pipeworks.check_for_horiz_tube check_for_horiz_pole = pipeworks.check_for_horiz_tube
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:one_way_tube" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:one_way_tube"
minetest.register_craft({
output = "pipeworks:one_way_tube 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "group:stick", "default:mese_crystal", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
end end

@ -11,7 +11,7 @@ local function after_break(pos)
end end
end end
if pipeworks.enable_detector_tube then if minetest.get_modpath("mesecons") and pipeworks.enable_detector_tube then
local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step")) local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step"))
pipeworks.register_tube("pipeworks:detector_tube_on", { pipeworks.register_tube("pipeworks:detector_tube_on", {
description = S("Detecting Pneumatic Tube Segment on"), description = S("Detecting Pneumatic Tube Segment on"),
@ -137,7 +137,7 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then
}) })
end end
if pipeworks.enable_conductor_tube then if minetest.get_modpath("mesecons") and pipeworks.enable_conductor_tube then
pipeworks.register_tube("pipeworks:conductor_tube_off", { pipeworks.register_tube("pipeworks:conductor_tube_off", {
description = S("Conducting Pneumatic Tube Segment"), description = S("Conducting Pneumatic Tube Segment"),
inventory_image = "pipeworks_conductor_tube_inv.png", inventory_image = "pipeworks_conductor_tube_inv.png",

@ -163,25 +163,4 @@ if pipeworks.enable_mese_tube then
end, end,
}, },
}) })
minetest.register_craft( {
output = "pipeworks:mese_tube_000000 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "", "default:mese_crystal", "" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "pipeworks:mese_tube_000000",
recipe = {
"pipeworks:tube_1",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment"
},
})
end end

@ -153,9 +153,7 @@ local function update_meta(meta, can_receive)
"label[7.0,0;"..S("Receive").."]".. "label[7.0,0;"..S("Receive").."]"..
"image_button[7.0,0.5;1,0.6;pipeworks_button_" .. cr_state .. ".png;cr" .. (can_receive and 0 or 1) .. ";;;false;pipeworks_button_interm.png]".. "image_button[7.0,0.5;1,0.6;pipeworks_button_" .. cr_state .. ".png;cr" .. (can_receive and 0 or 1) .. ";;;false;pipeworks_button_interm.png]"..
"button_exit[6.3,1.3;2,1;close;"..S("Close").."]".. "button_exit[6.3,1.3;2,1;close;"..S("Close").."]"..
"label[0.2,2.3;"..itext.."]".. "label[0.2,2.3;"..itext.."]")
default.gui_bg..
default.gui_bg_img)
end end
pipeworks.register_tube("pipeworks:teleport_tube", { pipeworks.register_tube("pipeworks:teleport_tube", {
@ -262,14 +260,6 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
end end
}, },
}) })
minetest.register_craft( {
output = "pipeworks:teleport_tube_1 2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:desert_stone", "default:mese", "default:desert_stone" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
if minetest.get_modpath("mesecons_mvps") ~= nil then if minetest.get_modpath("mesecons_mvps") ~= nil then
mesecon.register_on_mvps_move(function(moved_nodes) mesecon.register_on_mvps_move(function(moved_nodes)

@ -10,7 +10,7 @@ minetest.register_node("pipeworks:trashcan", {
"pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png",
"pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png",
}, },
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 4},
tube = { tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
return ItemStack("") return ItemStack("")
@ -25,10 +25,6 @@ minetest.register_node("pipeworks:trashcan", {
"item_image[0,0;1,1;pipeworks:trashcan]".. "item_image[0,0;1,1;pipeworks:trashcan]"..
"label[1,0;"..S("Trash Can").."]".. "label[1,0;"..S("Trash Can").."]"..
"list[context;trash;3.5,1;1,1;]".. "list[context;trash;3.5,1;1,1;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0,3) ..
"list[current_player;main;0,3;8,4;]" .. "list[current_player;main;0,3;8,4;]" ..
"listring[]") "listring[]")
meta:set_string("infotext", S("Trash Can")) meta:set_string("infotext", S("Trash Can"))
@ -41,12 +37,3 @@ minetest.register_node("pipeworks:trashcan", {
end, end,
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:trashcan" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:trashcan"
minetest.register_craft({
output = "pipeworks:trashcan",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
},
})

@ -61,13 +61,13 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
outimgs[vti[v]] = ends[v] outimgs[vti[v]] = ends[v]
end end
local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1} local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1, dig_generic = 4}
local tubedesc = string.format("%s %s", desc, dump(connects)) local tubedesc = string.format("%s %s", desc, dump(connects))
local iimg = type(plain[1]) == "table" and plain[1].name or plain[1] local iimg = type(plain[1]) == "table" and plain[1].name or plain[1]
local wscale = {x = 1, y = 1, z = 1} local wscale = {x = 1, y = 1, z = 1}
if #connects == 0 then if #connects == 0 then
tgroups = {snappy = 3, tube = 1, tubedevice = 1} tgroups = {snappy = 3, tube = 1, tubedevice = 1, dig_generic = 4}
tubedesc = desc tubedesc = desc
iimg=inv iimg=inv
outimgs = { outimgs = {
@ -102,7 +102,9 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
fixed = outboxes fixed = outboxes
}, },
groups = tgroups, groups = tgroups,
sounds = default.node_sound_wood_defaults(), _sound_def = {
key = "node_sound_wood_defaults",
},
walkable = true, walkable = true,
stack_max = 99, stack_max = 99,
basename = name, basename = name,

@ -46,9 +46,7 @@ if pipeworks.enable_mese_sand_tube then
"label[1.2,0.2;"..S("Adjustable Vacuuming Tube").."]".. "label[1.2,0.2;"..S("Adjustable Vacuuming Tube").."]"..
"field[0.5,1.6;2.1,1;dist;"..S("Radius")..";${dist}]".. "field[0.5,1.6;2.1,1;dist;"..S("Radius")..";${dist}]"..
"button[2.3,1.3;1.5,1;set_dist;"..S("Set").."]".. "button[2.3,1.3;1.5,1;set_dist;"..S("Set").."]"..
"button_exit[3.8,1.3;2,1;close;"..S("Close").."]".. "button_exit[3.8,1.3;2,1;close;"..S("Close").."]")
default.gui_bg..
default.gui_bg_img)
meta:set_string("infotext", S("Adjustable Vacuuming Pneumatic Tube Segment")) meta:set_string("infotext", S("Adjustable Vacuuming Pneumatic Tube Segment"))
end, end,
on_receive_fields = function(pos,formname,fields,sender) on_receive_fields = function(pos,formname,fields,sender)
@ -69,27 +67,6 @@ if pipeworks.enable_mese_sand_tube then
end, end,
}, },
}) })
minetest.register_craft( {
output = "pipeworks:mese_sand_tube_1 2",
recipe = {
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{"group:sand", "default:mese_crystal", "group:sand" },
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "pipeworks:mese_sand_tube_1",
recipe = {
"pipeworks:sand_tube_1",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment",
"default:mese_crystal_fragment"
},
})
end end
local function vacuum(pos, radius) local function vacuum(pos, radius)

@ -184,7 +184,9 @@ local function register_wielder(data)
paramtype2 = "facedir", paramtype2 = "facedir",
tubelike = 1, tubelike = 1,
groups = groups, groups = groups,
sounds = default.node_sound_stone_defaults(), _sound_def = {
key = "node_sound_stone_defaults",
},
drop = data.name_base.."_off", drop = data.name_base.."_off",
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -372,14 +374,6 @@ if pipeworks.enable_node_breaker then
} }
register_wielder(data) register_wielder(data)
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:nodebreaker_off" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:nodebreaker_off"
minetest.register_craft({
output = "pipeworks:nodebreaker_off",
recipe = {
{ "basic_materials:gear_steel", "basic_materials:gear_steel", "basic_materials:gear_steel" },
{ "default:stone", "mesecons:piston", "default:stone" },
{ "group:wood", "mesecons:mesecon", "group:wood" },
}
})
-- aliases for when someone had technic installed, but then uninstalled it but not pipeworks -- aliases for when someone had technic installed, but then uninstalled it but not pipeworks
minetest.register_alias("technic:nodebreaker_off", "pipeworks:nodebreaker_off") minetest.register_alias("technic:nodebreaker_off", "pipeworks:nodebreaker_off")
minetest.register_alias("technic:nodebreaker_on", "pipeworks:nodebreaker_on") minetest.register_alias("technic:nodebreaker_on", "pipeworks:nodebreaker_on")
@ -424,14 +418,6 @@ if pipeworks.enable_deployer then
eject_drops = false, eject_drops = false,
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:deployer_off" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:deployer_off"
minetest.register_craft({
output = "pipeworks:deployer_off",
recipe = {
{ "group:wood", "default:chest", "group:wood" },
{ "default:stone", "mesecons:piston", "default:stone" },
{ "default:stone", "mesecons:mesecon", "default:stone" },
}
})
-- aliases for when someone had technic installed, but then uninstalled it but not pipeworks -- aliases for when someone had technic installed, but then uninstalled it but not pipeworks
minetest.register_alias("technic:deployer_off", "pipeworks:deployer_off") minetest.register_alias("technic:deployer_off", "pipeworks:deployer_off")
minetest.register_alias("technic:deployer_on", "pipeworks:deployer_on") minetest.register_alias("technic:deployer_on", "pipeworks:deployer_on")
@ -460,12 +446,4 @@ if pipeworks.enable_dispenser then
eject_drops = false, eject_drops = false,
}) })
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:dispenser_off" pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:dispenser_off"
minetest.register_craft({
output = "pipeworks:dispenser_off",
recipe = {
{ "default:desert_sand", "default:chest", "default:desert_sand" },
{ "default:stone", "mesecons:piston", "default:stone" },
{ "default:stone", "mesecons:mesecon", "default:stone" },
}
})
end end