diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-13 09:48:45 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-13 09:48:45 -0400 |
commit | 1adee001dd438172cd4ff7e3c6e9ca168b0bdd58 (patch) | |
tree | 10695dbfc2754b729562eacf041f0bdb56314183 /digistuff/init.lua | |
parent | 2fa93b219eadfcdcf8f1d472aad046fc62d5b99d (diff) | |
download | dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.gz dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.bz2 dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.xz dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.zip |
update plantlife, digistuff, farming-redo, roads,
unified inventory, and fixed a few obsolete "overrides"
in the misc-overrides package.
Diffstat (limited to 'digistuff/init.lua')
-rw-r--r-- | digistuff/init.lua | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/digistuff/init.lua b/digistuff/init.lua index b35cb1b..351fb6b 100644 --- a/digistuff/init.lua +++ b/digistuff/init.lua @@ -930,6 +930,7 @@ minetest.register_craft({ }) if minetest.get_modpath("mesecons_noteblock") then + local validnbsounds = dofile(minetest.get_modpath("digistuff")..DIR_DELIM.."nbsounds.lua") minetest.register_node("digistuff:noteblock", { description = "Digilines Noteblock", groups = {cracky=3}, @@ -961,48 +962,22 @@ if minetest.get_modpath("mesecons_noteblock") then receptor = {}, effector = { action = function(pos,node,channel,msg) + if msg == "get_sounds" then + local soundnames = {} + for i in pairs(validnbsounds) do + table.insert(soundnames,i) + end + digiline:receptor_send(pos, digiline.rules.default, channel, soundnames) + end local meta = minetest.get_meta(pos) local setchan = meta:get_string("channel") if channel ~= setchan then return end - local valid_sounds = { - csharp = "mesecons_noteblock_csharp", - d = "mesecons_noteblock_d", - dsharp = "mesecons_noteblock_dsharp", - e = "mesecons_noteblock_e", - f = "mesecons_noteblock_f", - fsharp = "mesecons_noteblock_fsharp", - g = "mesecons_noteblock_g", - gsharp = "mesecons_noteblock_gsharp", - a = "mesecons_noteblock_a", - asharp = "mesecons_noteblock_asharp", - b = "mesecons_noteblock_b", - c = "mesecons_noteblock_c", - csharp2 = "mesecons_noteblock_csharp2", - d2 = "mesecons_noteblock_d2", - dsharp2 = "mesecons_noteblock_dsharp2", - e2 = "mesecons_noteblock_e2", - f2 = "mesecons_noteblock_f2", - fsharp2 = "mesecons_noteblock_fsharp2", - g2 = "mesecons_noteblock_g2", - gsharp2 = "mesecons_noteblock_gsharp2", - a2 = "mesecons_noteblock_a2", - asharp2 = "mesecons_noteblock_asharp2", - b2 = "mesecons_noteblock_b2", - c2 = "mesecons_noteblock_c2", - hihat = "mesecons_noteblock_hihat", - kick = "mesecons_noteblock_kick", - snare = "mesecons_noteblock_snare", - crash = "mesecons_noteblock_crash", - litecrash = "mesecons_noteblock_litecrash", - fire = "fire_large", - explosion = "tnt_explode" - } if type(msg) == "string" then - local sound = valid_sounds[msg] + local sound = validnbsounds[msg] if sound then minetest.sound_play(sound,{pos=pos}) end elseif type(msg) == "table" then if type(msg.sound) ~= "string" then return end - local sound = valid_sounds[msg.sound] + local sound = validnbsounds[msg.sound] local volume = 1 if type(msg.volume) == "number" then volume = math.max(0,math.min(1,msg.volume)) |