From 6f1ff244740b0de67949a187c76f473c3180bbba Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 28 Jan 2018 20:56:42 +0100 Subject: [PATCH 1/3] Add sounds for wires and piston heads --- mesecons_delayer/init.lua | 1 + mesecons_extrawires/corner.lua | 2 ++ mesecons_extrawires/crossover.lua | 4 ++++ mesecons_extrawires/tjunction.lua | 2 ++ mesecons_extrawires/vertical.lua | 9 ++++++--- mesecons_insulated/init.lua | 2 ++ mesecons_pistons/init.lua | 2 ++ mesecons_receiver/init.lua | 3 +++ mesecons_torch/init.lua | 2 ++ mesecons_wires/init.lua | 1 + 10 files changed, 25 insertions(+), 3 deletions(-) diff --git a/mesecons_delayer/init.lua b/mesecons_delayer/init.lua index 0cbfd42..94450db 100644 --- a/mesecons_delayer/init.lua +++ b/mesecons_delayer/init.lua @@ -158,6 +158,7 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), { end, delayer_time = delaytime, delayer_offstate = "mesecons_delayer:delayer_off_"..tostring(i), + sounds = default.node_sound_stone_defaults(), mesecons = { receptor = { diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua index 27cfab8..830ea4c 100644 --- a/mesecons_extrawires/corner.lua +++ b/mesecons_extrawires/corner.lua @@ -40,6 +40,7 @@ minetest.register_node("mesecons_extrawires:corner_on", { node_box = corner_nodebox, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_extrawires:corner_off", + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.on, @@ -68,6 +69,7 @@ minetest.register_node("mesecons_extrawires:corner_off", { selection_box = corner_selectionbox, node_box = corner_nodebox, groups = {dig_immediate = 3}, + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.off, diff --git a/mesecons_extrawires/crossover.lua b/mesecons_extrawires/crossover.lua index 4aefbbc..b8d66f7 100644 --- a/mesecons_extrawires/crossover.lua +++ b/mesecons_extrawires/crossover.lua @@ -34,6 +34,7 @@ minetest.register_node("mesecons_extrawires:crossover_off", { stack_max = 99, selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, groups = {dig_immediate=3, mesecon=3}, + sounds = default.node_sound_defaults(), mesecons = { conductor = { states = crossover_states, @@ -60,6 +61,7 @@ minetest.register_node("mesecons_extrawires:crossover_01", { stack_max = 99, selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, + sounds = default.node_sound_defaults(), mesecons = { conductor = { states = crossover_states, @@ -86,6 +88,7 @@ minetest.register_node("mesecons_extrawires:crossover_10", { stack_max = 99, selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, + sounds = default.node_sound_defaults(), mesecons = { conductor = { states = crossover_states, @@ -112,6 +115,7 @@ minetest.register_node("mesecons_extrawires:crossover_on", { stack_max = 99, selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, + sounds = default.node_sound_defaults(), mesecons = { conductor = { states = crossover_states, diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index 018ee48..a30afb9 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -41,6 +41,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", { node_box = tjunction_nodebox, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_extrawires:tjunction_off", + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.on, @@ -69,6 +70,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", { selection_box = tjunction_selectionbox, node_box = tjunction_nodebox, groups = {dig_immediate = 3}, + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.off, diff --git a/mesecons_extrawires/vertical.lua b/mesecons_extrawires/vertical.lua index 1cff013..1543194 100644 --- a/mesecons_extrawires/vertical.lua +++ b/mesecons_extrawires/vertical.lua @@ -88,7 +88,8 @@ mesecon.register_node("mesecons_extrawires:vertical", { is_vertical_conductor = true, drop = "mesecons_extrawires:vertical_off", after_place_node = vertical_update, - after_dig_node = vertical_update + after_dig_node = vertical_update, + sounds = default.node_sound_defaults(), },{ tiles = {"mesecons_wire_off.png"}, groups = {dig_immediate=3}, @@ -121,7 +122,8 @@ mesecon.register_node("mesecons_extrawires:vertical_top", { is_vertical_conductor = true, drop = "mesecons_extrawires:vertical_off", after_place_node = vertical_update, - after_dig_node = vertical_update + after_dig_node = vertical_update, + sounds = default.node_sound_defaults(), },{ tiles = {"mesecons_wire_off.png"}, mesecons = {conductor = { @@ -152,7 +154,8 @@ mesecon.register_node("mesecons_extrawires:vertical_bottom", { is_vertical_conductor = true, drop = "mesecons_extrawires:vertical_off", after_place_node = vertical_update, - after_dig_node = vertical_update + after_dig_node = vertical_update, + sounds = default.node_sound_defaults(), },{ tiles = {"mesecons_wire_off.png"}, mesecons = {conductor = { diff --git a/mesecons_insulated/init.lua b/mesecons_insulated/init.lua index 20abc64..8355be4 100644 --- a/mesecons_insulated/init.lua +++ b/mesecons_insulated/init.lua @@ -33,6 +33,7 @@ minetest.register_node("mesecons_insulated:insulated_on", { }, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_insulated:insulated_off", + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.on, offstate = "mesecons_insulated:insulated_off", @@ -66,6 +67,7 @@ minetest.register_node("mesecons_insulated:insulated_off", { fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 } }, groups = {dig_immediate = 3}, + sounds = default.node_sound_defaults(), mesecons = {conductor = { state = mesecon.state.off, onstate = "mesecons_insulated:insulated_on", diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index e10b604..386cffa 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -326,6 +326,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", { node_box = piston_pusher_box, on_rotate = piston_rotate_pusher, drop = "", + sounds = default.node_sound_wood_defaults(), }) -- Sticky ones @@ -403,6 +404,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", { node_box = piston_pusher_box, on_rotate = piston_rotate_pusher, drop = "", + sounds = default.node_sound_wood_defaults(), }) diff --git a/mesecons_receiver/init.lua b/mesecons_receiver/init.lua index edf6622..73ab10e 100644 --- a/mesecons_receiver/init.lua +++ b/mesecons_receiver/init.lua @@ -56,6 +56,7 @@ mesecon.register_node("mesecons_receiver:receiver", { }, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons:wire_00000000_off", + sounds = default.node_sound_defaults(), }, { tiles = { "receiver_top_off.png", @@ -104,6 +105,7 @@ mesecon.register_node("mesecons_receiver:receiver_up", { }, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons:wire_00000000_off", + sounds = default.node_sound_defaults(), }, { tiles = {"mesecons_wire_off.png"}, mesecons = {conductor = { @@ -148,6 +150,7 @@ mesecon.register_node("mesecons_receiver:receiver_down", { }, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons:wire_00000000_off", + sounds = default.node_sound_defaults(), }, { tiles = {"mesecons_wire_off.png"}, mesecons = {conductor = { diff --git a/mesecons_torch/init.lua b/mesecons_torch/init.lua index 5f1d25a..99701a8 100644 --- a/mesecons_torch/init.lua +++ b/mesecons_torch/init.lua @@ -60,6 +60,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_off", { selection_box = torch_selectionbox, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_torch:mesecon_torch_on", + sounds = default.node_sound_defaults(), mesecons = {receptor = { state = mesecon.state.off, rules = torch_get_output_rules @@ -81,6 +82,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", { groups = {dig_immediate=3}, light_source = default.LIGHT_MAX-5, description="Mesecon Torch", + sounds = default.node_sound_defaults(), mesecons = {receptor = { state = mesecon.state.on, rules = torch_get_output_rules diff --git a/mesecons_wires/init.lua b/mesecons_wires/init.lua index 1766a99..3ca9cbc 100644 --- a/mesecons_wires/init.lua +++ b/mesecons_wires/init.lua @@ -215,6 +215,7 @@ local function register_wires() walkable = false, drop = "mesecons:wire_00000000_off", mesecon_wire = true, + sounds = default.node_sound_defaults(), on_rotate = false, }, {tiles = tiles_off, mesecons = meseconspec_off, groups = groups_off}, {tiles = tiles_on, mesecons = meseconspec_on, groups = groups_on}) From 1b513d211185ace0be7e1f8792b61c65d54ecd23 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 28 Jan 2018 21:14:54 +0100 Subject: [PATCH 2/3] Fix sounds of pressure plates, change groups --- mesecons_pressureplates/init.lua | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua index 6337941..1a503e9 100644 --- a/mesecons_pressureplates/init.lua +++ b/mesecons_pressureplates/init.lua @@ -42,8 +42,18 @@ end -- tiles_on: textures of the pressure plate when active -- image: inventory and wield image of the pressure plate -- recipe: crafting recipe of the pressure plate +-- groups: groups +-- sounds: sound table + +function mesecon.register_pressure_plate(basename, description, textures_off, textures_on, image_w, image_i, recipe, groups, sounds) + local groups_off, groups_on + if not groups then + groups = {} + end + local groups_off = table.copy(groups) + local groups_on = table.copy(groups) + groups_on.not_in_creative_inventory = 1 -function mesecon.register_pressure_plate(basename, description, textures_off, textures_on, image_w, image_i, recipe) mesecon.register_node(basename, { drawtype = "nodebox", inventory_image = image_i, @@ -56,17 +66,18 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te on_construct = function(pos) minetest.get_node_timer(pos):start(mesecon.setting("pplate_interval", 0.1)) end, + sounds = sounds, },{ mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate }}, node_box = pp_box_off, selection_box = pp_box_off, - groups = {snappy = 2, oddly_breakable_by_hand = 3}, + groups = groups_off, tiles = textures_off },{ mesecons = {receptor = { state = mesecon.state.on, rules = mesecon.rules.pplate }}, node_box = pp_box_on, selection_box = pp_box_on, - groups = {snappy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, + groups = groups_on, tiles = textures_on }) @@ -83,7 +94,9 @@ mesecon.register_pressure_plate( {"jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on_edges.png"}, "jeija_pressure_plate_wood_wield.png", "jeija_pressure_plate_wood_inv.png", - {{"group:wood", "group:wood"}}) + {{"group:wood", "group:wood"}}, + { choppy = 3, oddly_breakable_by_hand = 3 }, + default.node_sound_wood_defaults()) mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_stone", @@ -92,4 +105,6 @@ mesecon.register_pressure_plate( {"jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on_edges.png"}, "jeija_pressure_plate_stone_wield.png", "jeija_pressure_plate_stone_inv.png", - {{"default:cobble", "default:cobble"}}) + {{"default:cobble", "default:cobble"}}, + { cracky = 3, oddly_breakable_by_hand = 3 }, + default.node_sound_stone_defaults()) From 5ae33542274c96b956a505263e8b23e636b8f208 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 28 Jan 2018 21:22:09 +0100 Subject: [PATCH 3/3] Change hydroturbine sound to metal --- mesecons_hydroturbine/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesecons_hydroturbine/init.lua b/mesecons_hydroturbine/init.lua index 395b8f6..afa21e9 100644 --- a/mesecons_hydroturbine/init.lua +++ b/mesecons_hydroturbine/init.lua @@ -22,7 +22,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_off", { type = "fixed", fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }, }, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), mesecons = {receptor = { state = mesecon.state.off }}, @@ -51,7 +51,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", { type = "fixed", fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }, }, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), mesecons = {receptor = { state = mesecon.state.on }},