make sounds work

This commit is contained in:
unknown 2022-03-05 21:38:34 -05:00
parent 16c9ee8dc4
commit ee341d493d
10 changed files with 82 additions and 28 deletions

View File

@ -16,7 +16,9 @@ minetest.register_node("pipeworks:steel_block_embedded_tube", {
paramtype2 = "facedir",
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
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,
@ -70,7 +72,9 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", {
paramtype2 = "facedir",
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
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,

View File

@ -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)
@ -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)
@ -248,7 +252,9 @@ minetest.register_node(nodename_valve_loaded, {
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(),
_sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
@ -298,7 +304,9 @@ minetest.register_node("pipeworks:grating", {
sunlight_propagates = true,
paramtype = "light",
groups = {snappy=3, pipe=1},
--sounds = default.node_sound_metal_defaults(),
_sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true,
pipe_connections = { top = 1 },
after_place_node = function(pos)
@ -323,7 +331,9 @@ minetest.register_node(nodename_spigot_empty, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1},
--sounds = default.node_sound_metal_defaults(),
_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 },
@ -358,7 +368,9 @@ minetest.register_node(nodename_spigot_loaded, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
--sounds = default.node_sound_metal_defaults(),
_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 },
@ -414,7 +426,9 @@ minetest.register_node(nodename_panel_empty, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1},
--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)
@ -434,7 +448,9 @@ minetest.register_node(nodename_panel_loaded, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
--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)
@ -464,7 +480,9 @@ minetest.register_node(nodename_sensor_empty, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1},
--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)
@ -503,7 +521,9 @@ minetest.register_node(nodename_sensor_loaded, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
--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)
@ -570,7 +590,9 @@ for fill = 0, 10 do
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1},
--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},
@ -598,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},
@ -625,7 +649,9 @@ minetest.register_node(nodename_fountain_empty, {
sunlight_propagates = true,
paramtype = "light",
groups = {snappy=3, pipe=1},
--sounds = default.node_sound_metal_defaults(),
_sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true,
pipe_connections = { bottom = 1 },
after_place_node = function(pos)
@ -660,7 +686,9 @@ minetest.register_node(nodename_fountain_loaded, {
sunlight_propagates = true,
paramtype = "light",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
--sounds = default.node_sound_metal_defaults(),
_sound_def = {
key = "node_sound_metal_defaults",
},
walkable = true,
pipe_connections = { bottom = 1 },
after_place_node = function(pos)
@ -710,7 +738,9 @@ minetest.register_node(nodename_sp_empty, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1},
--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)
@ -732,7 +762,9 @@ minetest.register_node(nodename_sp_loaded, {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
--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)

View File

@ -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)

View File

@ -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)

View File

@ -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
@ -1028,7 +1030,9 @@ minetest.register_node(BASENAME .. "_burnt", {
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 = {

View File

@ -2,5 +2,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
depends = basic_materials
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen, sound_api
min_minetest_version = 5.2.0

View File

@ -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)
@ -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)

View File

@ -178,7 +178,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)

View File

@ -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,

View File

@ -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)