Optional sounds

This commit is contained in:
Wuzzy 2017-02-15 14:03:39 +01:00
parent 6bfeb6604d
commit fe61103ea9

@ -1,12 +1,17 @@
-- Window Block -- Window Block
local sfx
if minetest.registered_modpath("default") then
sfx = default.node_sound_glass_defaults()
end
minetest.register_node("mesecons_window:window_closed", { minetest.register_node("mesecons_window:window_closed", {
description="Mesecon Window", description="Mesecon Window",
_doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is fully transparent to light and sunlight when powered.", _doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is fully transparent to light and sunlight when powered.",
tiles = {"mesecons_window_closed.png"}, tiles = {"mesecons_window_closed.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=3, oddly_breakable_by_hand=3}, groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(), sounds = sfx,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.off, state = mesecon.state.off,
rules = { --axes rules = { --axes
@ -31,7 +36,7 @@ minetest.register_node("mesecons_window:window_open", {
paramtype = "light", paramtype = "light",
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
drop = "mesecons_window:window_closed", drop = "mesecons_window:window_closed",
sounds = default.node_sound_glass_defaults(), sounds = sfx,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.on, state = mesecon.state.on,
rules = { rules = {
@ -59,7 +64,7 @@ minetest.register_node("mesecons_window:filter_closed", {
_doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is semi-transparent to light when powered.", _doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is semi-transparent to light when powered.",
is_ground_content = false, is_ground_content = false,
groups = {cracky=3, oddly_breakable_by_hand=3}, groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(), sounds = sfx,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.off, state = mesecon.state.off,
rules = { --axes rules = { --axes
@ -84,7 +89,7 @@ minetest.register_node("mesecons_window:filter_open", {
paramtype = "light", paramtype = "light",
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
drop = "mesecons_window:filter_closed", drop = "mesecons_window:filter_closed",
sounds = default.node_sound_glass_defaults(), sounds = sfx,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.on, state = mesecon.state.on,
rules = { rules = {
@ -113,7 +118,7 @@ minetest.register_node("mesecons_window:filter2_closed", {
tiles = {"mesecons_filter2_closed.png", "mesecons_filter2_closed_detail.png"}, tiles = {"mesecons_filter2_closed.png", "mesecons_filter2_closed_detail.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=3, oddly_breakable_by_hand=3}, groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(), sounds = sfx,
paramtype = "light", paramtype = "light",
sunlight_propagates = false, sunlight_propagates = false,
mesecons = {conductor = { mesecons = {conductor = {
@ -148,7 +153,7 @@ minetest.register_node("mesecons_window:filter2_open", {
sunlight_propagates = true, sunlight_propagates = true,
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
drop = "mesecons_window:filter2_closed", drop = "mesecons_window:filter2_closed",
sounds = default.node_sound_glass_defaults(), sounds = sfx,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.on, state = mesecon.state.on,
rules = { rules = {