From 5aa0501872c618171dc58ade1d75f0db989f3bd4 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:39:58 -0400 Subject: [PATCH] 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 --- autocrafter.lua | 15 +- common.lua | 2 +- crafts.lua | 369 ++++++++++++++++++++++++++++++++++------ decorative_tubes.lua | 40 ++--- devices.lua | 110 +++++++----- filter-injector.lua | 33 +--- flowing_logic.lua | 16 +- init.lua | 18 +- legacy.lua | 4 +- lua_tube.lua | 12 +- mod.conf | 4 +- pipes.lua | 14 +- pressure_logic/abms.lua | 8 +- routing_tubes.lua | 36 +--- signal_tubes.lua | 4 +- sorting_tubes.lua | 21 --- teleport_tube.lua | 12 +- trashcan.lua | 15 +- tube_registration.lua | 8 +- vacuum_tubes.lua | 25 +-- wielder.lua | 28 +-- 21 files changed, 466 insertions(+), 328 deletions(-) diff --git a/autocrafter.lua b/autocrafter.lua index 2404188..7ec4436 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -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]" .. "list[context;src;0,4.5;8,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;]" .. "listring[current_player;main]".. "listring[context;src]" .. @@ -252,7 +248,7 @@ minetest.register_node("pipeworks:autocrafter", { description = S("Autocrafter"), drawtype = "normal", 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) local meta = minetest.get_meta(pos) 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" - -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" } - }, -}) diff --git a/common.lua b/common.lua index 207b728..3d40491 100644 --- a/common.lua +++ b/common.lua @@ -183,7 +183,7 @@ function pipeworks.create_fake_player(def, is_dynamic) is_player = delay(true), is_fake_player = true, - _formspec = def.formspec or default.gui_survival_form, + _formspec = def.formspec or "", _hp = def.hp or 20, _breath = 11, _pos = def.position and table.copy(def.position) or vector.new(), diff --git a/crafts.lua b/crafts.lua index 9c02da8..178cfc2 100644 --- a/crafts.lua +++ b/crafts.lua @@ -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 minetest.register_craft( { - output = "pipeworks:pipe_1_empty 12", - recipe = { - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, - { "", "", "" }, - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } - }, + output = "pipeworks:pipe_1_empty 12", + recipe = { + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }, + { "", "", "" }, + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot } + }, }) minetest.register_craft( { - output = "pipeworks:straight_pipe_empty 3", - recipe = { - { "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty" }, - }, + output = "pipeworks:straight_pipe_empty 3", + recipe = { + { "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty", "pipeworks:pipe_1_empty" }, + }, }) minetest.register_craft( { - output = "pipeworks:spigot 3", - recipe = { - { "pipeworks:pipe_1_empty", "" }, - { "", "pipeworks:pipe_1_empty" }, - }, + output = "pipeworks:spigot 3", + recipe = { + { "pipeworks:pipe_1_empty", "" }, + { "", "pipeworks:pipe_1_empty" }, + }, }) minetest.register_craft( { - output = "pipeworks:entry_panel_empty 2", - recipe = { - { "", "default:steel_ingot", "" }, - { "", "pipeworks:pipe_1_empty", "" }, - { "", "default:steel_ingot", "" }, - }, +output = "pipeworks:entry_panel_empty 2", +recipe = { + { "", materials.steel_ingot, "" }, + { "", "pipeworks:pipe_1_empty", "" }, + { "", materials.steel_ingot, "" }, +}, }) -- Various ancillary pipe devices minetest.register_craft( { - output = "pipeworks:pump_off 2", - recipe = { - { "default:stone", "default:steel_ingot", "default:stone" }, - { "default:copper_ingot", "default:mese_crystal_fragment", "default:copper_ingot" }, - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } - }, + output = "pipeworks:pump_off 2", + recipe = { + { materials.stone, materials.steel_ingot, materials.stone }, + { materials.copper_ingot, materials.mese_crystal_fragment, materials.copper_ingot }, + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot } + }, }) minetest.register_craft( { - output = "pipeworks:valve_off_empty 2", - recipe = { - { "", "group:stick", "" }, - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, - { "", "default:steel_ingot", "" } - }, + output = "pipeworks:valve_off_empty 2", + recipe = { + { "", "group:stick", "" }, + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }, + { "", materials.steel_ingot, "" } + }, }) minetest.register_craft( { - output = "pipeworks:storage_tank_0 2", - recipe = { - { "", "default:steel_ingot", "default:steel_ingot" }, - { "default:steel_ingot", "default:glass", "default:steel_ingot" }, - { "default:steel_ingot", "default:steel_ingot", "" } - }, + output = "pipeworks:storage_tank_0 2", + recipe = { + { "", materials.steel_ingot, materials.steel_ingot }, + { materials.steel_ingot, materials.glass, materials.steel_ingot }, + { materials.steel_ingot, materials.steel_ingot, "" } + }, }) minetest.register_craft( { - output = "pipeworks:grating 2", - recipe = { - { "default:steel_ingot", "", "default:steel_ingot" }, - { "", "pipeworks:pipe_1_empty", "" }, - { "default:steel_ingot", "", "default:steel_ingot" } - }, + output = "pipeworks:grating 2", + recipe = { + { materials.steel_ingot, "", materials.steel_ingot }, + { "", "pipeworks:pipe_1_empty", "" }, + { materials.steel_ingot, "", materials.steel_ingot } + }, }) minetest.register_craft( { - output = "pipeworks:flow_sensor_empty 2", - recipe = { - { "pipeworks:pipe_1_empty", "mesecons:mesecon", "pipeworks:pipe_1_empty" }, - }, + output = "pipeworks:flow_sensor_empty 2", + recipe = { + { "pipeworks:pipe_1_empty", "mesecons:mesecon", "pipeworks:pipe_1_empty" }, + }, }) minetest.register_craft( { - output = "pipeworks:fountainhead 2", - recipe = { - { "pipeworks:pipe_1_empty" }, - { "pipeworks:pipe_1_empty" } - }, + output = "pipeworks:fountainhead 2", + recipe = { + { "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 \ No newline at end of file diff --git a/decorative_tubes.lua b/decorative_tubes.lua index 308330b..d79f8af 100644 --- a/decorative_tubes.lua +++ b/decorative_tubes.lua @@ -1,20 +1,24 @@ local S = minetest.get_translator("pipeworks") 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", { description = S("Airtight steelblock embedded tube"), tiles = { - "default_steel_block.png", "default_steel_block.png", - "default_steel_block.png", "default_steel_block.png", - "default_steel_block.png^pipeworks_tube_connection_metallic.png", - "default_steel_block.png^pipeworks_tube_connection_metallic.png", + steel_tex, steel_tex, + steel_tex, steel_tex, + steel_tex .. "^pipeworks_tube_connection_metallic.png", + steel_tex .. "^pipeworks_tube_connection_metallic.png", }, paramtype = "light", 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, - sounds = default.node_sound_stone_defaults(), + _sound_def = { + key = "node_sound_stone_defaults", + }, tube = { connect_sides = {front = 1, back = 1,}, 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" -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 = { type = "fixed", fixed = { @@ -66,9 +61,11 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", { collision_box = pane_box, paramtype = "light", 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, - sounds = default.node_sound_stone_defaults(), + _sound_def = { + key = "node_sound_stone_defaults", + }, tube = { connect_sides = {front = 1, back = 1,}, priority = 50, @@ -83,12 +80,3 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", { on_rotate = pipeworks.on_rotate, }) 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", "" } - }, -}) diff --git a/devices.lua b/devices.lua index 0acbc76..d6bfced 100644 --- a/devices.lua +++ b/devices.lua @@ -133,9 +133,9 @@ for s in ipairs(states) do local dgroups if states[s] == "off" then - dgroups = {snappy=3, pipe=1} + dgroups = {snappy=3, pipe=1, dig_generic = 4} 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 local pumpname = "pipeworks:pump_"..states[s] @@ -148,7 +148,9 @@ for s in ipairs(states) do paramtype = "light", paramtype2 = "facedir", groups = dgroups, - sounds = default.node_sound_metal_defaults(), + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { top = 1 }, after_place_node = function(pos) @@ -170,7 +172,7 @@ for s in ipairs(states) do local fdir = node.param2 minetest.swap_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir }) 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+. @@ -200,7 +202,9 @@ for s in ipairs(states) do fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 } }, groups = dgroups, - sounds = default.node_sound_metal_defaults(), + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -247,8 +251,10 @@ minetest.register_node(nodename_valve_loaded, { type = "fixed", fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 } }, - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -297,8 +303,10 @@ minetest.register_node("pipeworks:grating", { }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { top = 1 }, after_place_node = function(pos) @@ -322,8 +330,10 @@ minetest.register_node(nodename_spigot_empty, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { left=1, right=1, front=1, back=1, left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 }, @@ -350,23 +360,17 @@ minetest.register_node(nodename_spigot_loaded, { drawtype = "mesh", mesh = "pipeworks_spigot_pouring"..polys..".obj", tiles = { - { - name = "default_water_flowing_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.8, - }, - }, + minetest.registered_nodes[pipeworks.liquids.water.source].tiles[1], { name = "pipeworks_spigot.png" } }, use_texture_alpha = texture_alpha_mode and "blend" or true, sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { left=1, right=1, front=1, back=1, 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" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -441,8 +447,10 @@ minetest.register_node(nodename_panel_loaded, { tiles = { "pipeworks_entry_panel.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -471,8 +479,10 @@ minetest.register_node(nodename_sensor_empty, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -510,8 +520,10 @@ minetest.register_node(nodename_sensor_loaded, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, 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. for fill = 0, 10 do 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 if fill ~= 0 then 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" end @@ -577,8 +589,10 @@ for fill = 0, 10 do inventory_image = image, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, drop = "pipeworks:storage_tank_0", pipe_connections = { top = 1, bottom = 1}, @@ -606,7 +620,9 @@ for fill = 0, 10 do paramtype = "light", paramtype2 = "facedir", groups = sgroups, - sounds = default.node_sound_metal_defaults(), + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, drop = "pipeworks:storage_tank_0", pipe_connections = { top = 1, bottom = 1}, @@ -632,8 +648,10 @@ minetest.register_node(nodename_fountain_empty, { tiles = { "pipeworks_fountainhead.png" }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { bottom = 1 }, after_place_node = function(pos) @@ -667,8 +685,10 @@ minetest.register_node(nodename_fountain_loaded, { tiles = { "pipeworks_fountainhead.png" }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, pipe_connections = { bottom = 1 }, after_place_node = function(pos) @@ -717,8 +737,10 @@ minetest.register_node(nodename_sp_empty, { tiles = { "pipeworks_straight_pipe_empty.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) @@ -739,8 +761,10 @@ minetest.register_node(nodename_sp_loaded, { tiles = { "pipeworks_straight_pipe_loaded.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, on_place = pipeworks.rotate_on_place, after_dig_node = function(pos) diff --git a/filter-injector.lua b/filter-injector.lua index 5ae3719..a155307 100644 --- a/filter-injector.lua +++ b/filter-injector.lua @@ -377,7 +377,9 @@ for _, data in ipairs({ paramtype2 = "facedir", groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + _sound_def = { + key = "node_sound_wood_defaults", + }, on_construct = function(pos) local meta = minetest.get_meta(pos) 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 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 puts them to the input to the filter-injector if possible. Else the items are diff --git a/flowing_logic.lua b/flowing_logic.lua index 55c3ac7..b1c12aa 100644 --- a/flowing_logic.lua +++ b/flowing_logic.lua @@ -83,7 +83,7 @@ end pipeworks.spigot_check = function(pos, node) 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 fdir=node.param2 % 4 local check = { @@ -96,14 +96,14 @@ pipeworks.spigot_check = function(pos, node) if near_node and string.find(near_node.name, "_loaded") then if spigotname and spigotname == "pipeworks:spigot" then minetest.add_node(pos,{name = "pipeworks:spigot_pouring", param2 = fdir}) - if finitewater or belowname ~= "default:water_source" then - minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z},{name = "default:water_source"}) + if finitewater or belowname ~= pipeworks.liquids.water.source then + minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z},{name = pipeworks.liquids.water.source}) end end else if spigotname == "pipeworks:spigot_pouring" then 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}) end end @@ -113,20 +113,20 @@ end pipeworks.fountainhead_check = function(pos, node) 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 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 fountainhead_name and fountainhead_name == "pipeworks:fountainhead" then minetest.add_node(pos,{name = "pipeworks:fountainhead_pouring"}) - if finitewater or abovename ~= "default:water_source" then - minetest.add_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "default:water_source"}) + if finitewater or abovename ~= pipeworks.liquids.water.source then + minetest.add_node({x=pos.x,y=pos.y+1,z=pos.z},{name = pipeworks.liquids.water.source}) end end else if fountainhead_name == "pipeworks:fountainhead_pouring" then 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}) end end diff --git a/init.lua b/init.lua index beeefb7..8fb0b31 100644 --- a/init.lua +++ b/init.lua @@ -11,6 +11,16 @@ pipeworks.worldpath = minetest.get_worldpath() pipeworks.modpath = minetest.get_modpath("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") -- Read the external config file if it exists. 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.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_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.."/item_transport.lua") dofile(pipeworks.modpath.."/flowing_logic.lua") -dofile(pipeworks.modpath.."/crafts.lua") dofile(pipeworks.modpath.."/tube_registration.lua") dofile(pipeworks.modpath.."/routing_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_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_redefines then +if pipeworks.enable_redefines and minetest.get_modpath("default") then dofile(pipeworks.modpath.."/compat-chests.lua") dofile(pipeworks.modpath.."/compat-furnaces.lua") end @@ -147,6 +157,8 @@ if pipeworks.enable_lua_tube and dofile(pipeworks.modpath.."/lua_tube.lua") end +dofile(pipeworks.modpath.."/crafts.lua") + minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") -- Unified Inventory categories integration diff --git a/legacy.lua b/legacy.lua index 72f8cb4..a426a62 100644 --- a/legacy.lua +++ b/legacy.lua @@ -27,7 +27,9 @@ if not minetest.get_modpath("auto_tree_tap") and is_ground_content = true, paramtype2 = "facedir", 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}}, on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/lua_tube.lua b/lua_tube.lua index c5fd24c..0898749 100644 --- a/lua_tube.lua +++ b/lua_tube.lua @@ -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[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 groups.not_in_creative_inventory = 1 end @@ -918,7 +918,9 @@ for white = 0, 1 do node_box = node_box, on_construct = reset_meta, on_receive_fields = on_receive_fields, - sounds = default.node_sound_wood_defaults(), + _sound_def = { + key = "node_sound_wood_defaults", + }, mesecons = mesecons, digiline = digiline, -- Virtual portstates are the ports that @@ -1021,14 +1023,16 @@ minetest.register_node(BASENAME .. "_burnt", { is_burnt = true, paramtype = "light", 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", sunlight_propagates = true, selection_box = selection_box, node_box = node_box, on_construct = reset_meta, 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, green = false, black = false, white = false}, mesecons = { diff --git a/mod.conf b/mod.conf index 17fd51c..c95a9c7 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,5 @@ 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. -depends = default, basic_materials, screwdriver -optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory +depends = basic_materials +optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen, sound_api min_minetest_version = 5.2.0 diff --git a/pipes.lua b/pipes.lua index befbbb9..5ab7c61 100644 --- a/pipes.lua +++ b/pipes.lua @@ -37,11 +37,11 @@ for index, connects in ipairs(cconnects) do 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) if #connects == 0 then - pgroups = {snappy = 3, tube = 1} + pgroups = {snappy = 3, tube = 1, dig_generic = 4} pipedesc = S("Pipe Segment") end @@ -76,7 +76,9 @@ for index, connects in ipairs(cconnects) do fixed = outsel }, groups = pgroups, - sounds = default.node_sound_metal_defaults(), + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, drop = "pipeworks:pipe_1_empty", after_place_node = function(pos) @@ -91,7 +93,7 @@ for index, connects in ipairs(cconnects) do 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", { description = pipedesc, @@ -110,7 +112,9 @@ for index, connects in ipairs(cconnects) do fixed = outsel }, groups = pgroups, - sounds = default.node_sound_metal_defaults(), + _sound_def = { + key = "node_sound_metal_defaults", + }, walkable = true, drop = "pipeworks:pipe_1_empty", after_place_node = function(pos) diff --git a/pressure_logic/abms.lua b/pressure_logic/abms.lua index 50951b0..2675b7c 100644 --- a/pressure_logic/abms.lua +++ b/pressure_logic/abms.lua @@ -42,7 +42,7 @@ local check_for_liquids_v2 = function(pos, limit) for _, tpos in ipairs(coords) do if total >= limit then break end local name = minetest.get_node(tpos).name - if name == "default:water_source" then + if name == pipeworks.liquids.water.source then minetest.remove_node(tpos) total = total + 1 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. -- so in non-finite mode, placing water is dependent on the target node; -- 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 - minetest.swap_node(npos, {name="default:water_source"}) + minetest.swap_node(npos, {name=pipeworks.liquids.water.source}) end if (not finitemode) or canplace then taken = taken + 1 @@ -268,7 +268,7 @@ flowlogic.helpers.make_neighbour_cleanup_fixed = function(neighbours) for _, offset in pairs(neighbours) do local npos = vector.add(pos, offset) 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)) minetest.remove_node(npos) end diff --git a/routing_tubes.lua b/routing_tubes.lua index a99d1c3..5e5fe0a 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -106,14 +106,6 @@ if pipeworks.enable_priority_tube then 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 if pipeworks.enable_accelerator_tube then @@ -131,14 +123,6 @@ if pipeworks.enable_accelerator_tube then 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 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 } }, }) - 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 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", 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}, - sounds = default.node_sound_wood_defaults(), + _sound_def = { + key = "node_sound_wood_defaults", + }, tube = { connect_sides = {left = 1, right = 1}, 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 }) 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 diff --git a/signal_tubes.lua b/signal_tubes.lua index cabf488..2713507 100644 --- a/signal_tubes.lua +++ b/signal_tubes.lua @@ -11,7 +11,7 @@ local function after_break(pos) 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")) pipeworks.register_tube("pipeworks:detector_tube_on", { description = S("Detecting Pneumatic Tube Segment on"), @@ -137,7 +137,7 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then }) 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", { description = S("Conducting Pneumatic Tube Segment"), inventory_image = "pipeworks_conductor_tube_inv.png", diff --git a/sorting_tubes.lua b/sorting_tubes.lua index 10a81a6..0168fad 100644 --- a/sorting_tubes.lua +++ b/sorting_tubes.lua @@ -163,25 +163,4 @@ if pipeworks.enable_mese_tube then 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 diff --git a/teleport_tube.lua b/teleport_tube.lua index c59f740..b41d525 100644 --- a/teleport_tube.lua +++ b/teleport_tube.lua @@ -153,9 +153,7 @@ local function update_meta(meta, can_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]".. "button_exit[6.3,1.3;2,1;close;"..S("Close").."]".. - "label[0.2,2.3;"..itext.."]".. - default.gui_bg.. - default.gui_bg_img) + "label[0.2,2.3;"..itext.."]") end pipeworks.register_tube("pipeworks:teleport_tube", { @@ -262,14 +260,6 @@ pipeworks.register_tube("pipeworks:teleport_tube", { 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 mesecon.register_on_mvps_move(function(moved_nodes) diff --git a/trashcan.lua b/trashcan.lua index 361d73e..e106761 100644 --- a/trashcan.lua +++ b/trashcan.lua @@ -10,7 +10,7 @@ minetest.register_node("pipeworks:trashcan", { "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 = { insert_object = function(pos, node, stack, direction) return ItemStack("") @@ -25,10 +25,6 @@ minetest.register_node("pipeworks:trashcan", { "item_image[0,0;1,1;pipeworks:trashcan]".. "label[1,0;"..S("Trash Can").."]".. "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;]" .. "listring[]") meta:set_string("infotext", S("Trash Can")) @@ -41,12 +37,3 @@ minetest.register_node("pipeworks:trashcan", { end, }) 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" }, - }, -}) diff --git a/tube_registration.lua b/tube_registration.lua index e1859f9..c621cd8 100644 --- a/tube_registration.lua +++ b/tube_registration.lua @@ -61,13 +61,13 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e outimgs[vti[v]] = ends[v] 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 iimg = type(plain[1]) == "table" and plain[1].name or plain[1] local wscale = {x = 1, y = 1, z = 1} if #connects == 0 then - tgroups = {snappy = 3, tube = 1, tubedevice = 1} + tgroups = {snappy = 3, tube = 1, tubedevice = 1, dig_generic = 4} tubedesc = desc iimg=inv outimgs = { @@ -102,7 +102,9 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e fixed = outboxes }, groups = tgroups, - sounds = default.node_sound_wood_defaults(), + _sound_def = { + key = "node_sound_wood_defaults", + }, walkable = true, stack_max = 99, basename = name, diff --git a/vacuum_tubes.lua b/vacuum_tubes.lua index 927480b..f6a3546 100644 --- a/vacuum_tubes.lua +++ b/vacuum_tubes.lua @@ -46,9 +46,7 @@ if pipeworks.enable_mese_sand_tube then "label[1.2,0.2;"..S("Adjustable Vacuuming Tube").."]".. "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_exit[3.8,1.3;2,1;close;"..S("Close").."]".. - default.gui_bg.. - default.gui_bg_img) + "button_exit[3.8,1.3;2,1;close;"..S("Close").."]") meta:set_string("infotext", S("Adjustable Vacuuming Pneumatic Tube Segment")) end, on_receive_fields = function(pos,formname,fields,sender) @@ -69,27 +67,6 @@ if pipeworks.enable_mese_sand_tube then 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 local function vacuum(pos, radius) diff --git a/wielder.lua b/wielder.lua index 22df13f..92d121a 100644 --- a/wielder.lua +++ b/wielder.lua @@ -184,7 +184,9 @@ local function register_wielder(data) paramtype2 = "facedir", tubelike = 1, groups = groups, - sounds = default.node_sound_stone_defaults(), + _sound_def = { + key = "node_sound_stone_defaults", + }, drop = data.name_base.."_off", on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -372,14 +374,6 @@ if pipeworks.enable_node_breaker then } register_wielder(data) 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 minetest.register_alias("technic:nodebreaker_off", "pipeworks:nodebreaker_off") minetest.register_alias("technic:nodebreaker_on", "pipeworks:nodebreaker_on") @@ -424,14 +418,6 @@ if pipeworks.enable_deployer then eject_drops = false, }) 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 minetest.register_alias("technic:deployer_off", "pipeworks:deployer_off") minetest.register_alias("technic:deployer_on", "pipeworks:deployer_on") @@ -460,12 +446,4 @@ if pipeworks.enable_dispenser then eject_drops = false, }) 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