This commit is contained in:
wsor4035 2024-02-29 22:39:17 -05:00 committed by GitHub
parent 53c0826bff
commit 95d24b4e26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,291 +6,291 @@ local sound_api = {}
--currently loggy and bedrock are ignored --currently loggy and bedrock are ignored
local ks = {} local ks = {}
function ks.node_sound_defaults(table) function ks.node_sound_defaults(soundtable)
table = table or {} soundtable = soundtable or {}
table.footstep = table.footstep or ks_sounds.generalnode_sounds.footstep soundtable.footstep = soundtable.footstep or ks_sounds.generalnode_sounds.footstep
table.dug = table.dug or ks_sounds.generalnode_sounds.dug soundtable.dug = soundtable.dug or ks_sounds.generalnode_sounds.dug
table.dig = table.dig or ks_sounds.generalnode_sounds.dig soundtable.dig = soundtable.dig or ks_sounds.generalnode_sounds.dig
table.place = table.place or ks_sounds.generalnode_sounds.place soundtable.place = soundtable.place or ks_sounds.generalnode_sounds.place
return table return soundtable
end end
function ks.node_sound_wood_defaults(table) function ks.node_sound_wood_defaults(soundtable)
table = table or {} soundtable = soundtable or {}
table.footstep = table.footstep or ks_sounds.woodennode_sounds.footstep soundtable.footstep = soundtable.footstep or ks_sounds.woodennode_sounds.footstep
table.dug = table.dug or ks_sounds.woodennode_sounds.dug soundtable.dug = soundtable.dug or ks_sounds.woodennode_sounds.dug
table.dig = table.dig or ks_sounds.woodennode_sounds.dig soundtable.dig = soundtable.dig or ks_sounds.woodennode_sounds.dig
table.place = table.place or ks_sounds.woodennode_sounds.place soundtable.place = soundtable.place or ks_sounds.woodennode_sounds.place
ks.node_sound_defaults(table) ks.node_sound_defaults(soundtable)
return table return soundtable
end end
function ks.node_sound_leaves_defaults(table) function ks.node_sound_leaves_defaults(soundtable)
table = table or {} soundtable = soundtable or {}
table.footstep = table.footstep or ks_sounds.leafynode_sounds.footstep soundtable.footstep = soundtable.footstep or ks_sounds.leafynode_sounds.footstep
table.dug = table.dug or ks_sounds.leafynode_sounds.dug soundtable.dug = soundtable.dug or ks_sounds.leafynode_sounds.dug
table.dig = table.dig or ks_sounds.leafynode_sounds.dig soundtable.dig = soundtable.dig or ks_sounds.leafynode_sounds.dig
table.place = table.place or ks_sounds.leafynode_sounds.place soundtable.place = soundtable.place or ks_sounds.leafynode_sounds.place
ks.node_sound_defaults(table) ks.node_sound_defaults(soundtable)
return table return soundtable
end end
function ks.node_sound_snow_defaults(table) function ks.node_sound_snow_defaults(soundtable)
table = table or {} soundtable = soundtable or {}
table.footstep = table.footstep or ks_sounds.snowynode_sounds.footstep soundtable.footstep = soundtable.footstep or ks_sounds.snowynode_sounds.footstep
table.dug = table.dug or ks_sounds.snowynode_sounds.dug soundtable.dug = soundtable.dug or ks_sounds.snowynode_sounds.dug
table.dig = table.dig or ks_sounds.snowynode_sounds.dig soundtable.dig = soundtable.dig or ks_sounds.snowynode_sounds.dig
table.place = table.place or ks_sounds.snowynode_sounds.place soundtable.place = soundtable.place or ks_sounds.snowynode_sounds.place
ks.node_sound_defaults(table) ks.node_sound_defaults(soundtable)
return table return soundtable
end end
--api --api
function sound_api.node_sound_default(table) function sound_api.node_sound_default(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_defaults(table) return default.node_sound_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_defaults(table) return mcl_sounds.node_sound_defaults(soundtable)
elseif minetest.get_modpath("ks_sounds") then elseif minetest.get_modpath("ks_sounds") then
return ks.node_sound_default(table) return ks.node_sound_default(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_default(table) return nodes_nature.node_sound_default(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_defaults(table) return hades_sounds.node_sound_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_defaults(table) return rp_sounds.node_sound_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_stone_defaults(table) function sound_api.node_sound_stone_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_stone_defaults(table) return default.node_sound_stone_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_stone_defaults(table) return mcl_sounds.node_sound_stone_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_stone_defaults(table) return nodes_nature.node_sound_stone_defaults(soundtable)
elseif minetest.get_modpath("fl_stone") then elseif minetest.get_modpath("fl_stone") then
return fl_stone.sounds.stone(table) return fl_stone.sounds.stone(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_stone_defaults(table) return hades_sounds.node_sound_stone_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_stone_defaults(table) return rp_sounds.node_sound_stone_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_dirt_defaults(table) function sound_api.node_sound_dirt_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_dirt_defaults(table) return default.node_sound_dirt_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_dirt_defaults(table) return mcl_sounds.node_sound_dirt_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_dirt_defaults(table) return nodes_nature.node_sound_dirt_defaults(soundtable)
--s/dirt/grass --s/dirt/grass
elseif minetest.get_modpath("fl_topsoil") then elseif minetest.get_modpath("fl_topsoil") then
return fl_topsoil.sounds.grass(table) return fl_topsoil.sounds.grass(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_dirt_defaults(table) return hades_sounds.node_sound_dirt_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_dirt_defaults(table) return rp_sounds.node_sound_dirt_defaults(soundtable)
else else
return table return soundtable
end end
end end
--return dirt as some games use dirt vs grass --return dirt as some games use dirt vs grass
function sound_api.node_sound_grass_defaults(table) function sound_api.node_sound_grass_defaults(soundtable)
if minetest.get_modpath("hades_sounds") then if minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_grass_defaults(table) return hades_sounds.node_sound_grass_defaults(soundtable)
else else
return sound_api.node_sound_dirt_defaults(table) return sound_api.node_sound_dirt_defaults(soundtable)
end end
end end
function sound_api.node_sound_sand_defaults(table) function sound_api.node_sound_sand_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_sand_defaults(table) return default.node_sound_sand_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_sand_defaults(table) return mcl_sounds.node_sound_sand_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_sand_defaults(table) return nodes_nature.node_sound_sand_defaults(soundtable)
elseif minetest.get_modpath("fl_stone") then elseif minetest.get_modpath("fl_stone") then
return fl_stone.sounds.sand(table) return fl_stone.sounds.sand(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_sand_defaults(table) return hades_sounds.node_sound_sand_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_sand_defaults(table) return rp_sounds.node_sound_sand_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_gravel_defaults(table) function sound_api.node_sound_gravel_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_gravel_defaults(table) return default.node_sound_gravel_defaults(soundtable)
--s/gravel/sand --s/gravel/sand
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_sand_defaults(table) return mcl_sounds.node_sound_sand_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_gravel_defaults(table) return nodes_nature.node_sound_gravel_defaults(soundtable)
elseif minetest.get_modpath("fl_topsoil") then elseif minetest.get_modpath("fl_topsoil") then
return fl_topsoil.sounds.gravel(table) return fl_topsoil.sounds.gravel(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_gravel_defaults(table) return hades_sounds.node_sound_gravel_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_wood_defaults(table) function sound_api.node_sound_wood_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_wood_defaults(table) return default.node_sound_wood_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_wood_defaults(table) return mcl_sounds.node_sound_wood_defaults(soundtable)
elseif minetest.get_modpath("ks_sounds") then elseif minetest.get_modpath("ks_sounds") then
return ks.node_sound_wood_default(table) return ks.node_sound_wood_default(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_wood_defaults(table) return nodes_nature.node_sound_wood_defaults(soundtable)
elseif minetest.get_modpath("fl_trees") then elseif minetest.get_modpath("fl_trees") then
return fl_trees.sounds.wood(table) return fl_trees.sounds.wood(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_wood_defaults(table) return hades_sounds.node_sound_wood_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_wood_defaults(table) return rp_sounds.node_sound_wood_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_leaves_defaults(table) function sound_api.node_sound_leaves_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_leaves_defaults(table) return default.node_sound_leaves_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_leaves_defaults(table) return mcl_sounds.node_sound_leaves_defaults(soundtable)
elseif minetest.get_modpath("ks_sounds") then elseif minetest.get_modpath("ks_sounds") then
return ks.node_sound_leaves_default(table) return ks.node_sound_leaves_default(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_leaves_defaults(table) return nodes_nature.node_sound_leaves_defaults(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_leaves_defaults(table) return hades_sounds.node_sound_leaves_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_leaves_defaults(table) return rp_sounds.node_sound_leaves_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_glass_defaults(table) function sound_api.node_sound_glass_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_glass_defaults(table) return default.node_sound_glass_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_glass_defaults(table) return mcl_sounds.node_sound_glass_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_glass_defaults(table) return nodes_nature.node_sound_glass_defaults(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_glass_defaults(table) return hades_sounds.node_sound_glass_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_glass_defaults(table) return rp_sounds.node_sound_glass_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_ice_defaults(table) function sound_api.node_sound_ice_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_ice_defaults(table) return default.node_sound_ice_defaults(soundtable)
--s/ice/glass --s/ice/glass
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_glass_defaults(table) return mcl_sounds.node_sound_glass_defaults(soundtable)
--s/ice/glass --s/ice/glass
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_glass_defaults(table) return nodes_nature.node_sound_glass_defaults(soundtable)
--s/ice/glass --s/ice/glass
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_glass_defaults(table) return hades_sounds.node_sound_glass_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_metal_defaults(table) function sound_api.node_sound_metal_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_metal_defaults(table) return default.node_sound_metal_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_metal_defaults(table) return mcl_sounds.node_sound_metal_defaults(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_metal_defaults(table) return hades_sounds.node_sound_metal_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_water_defaults(table) function sound_api.node_sound_water_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_water_defaults(table) return default.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_water_defaults(table) return mcl_sounds.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_water_defaults(table) return nodes_nature.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_water_defaults(table) return hades_sounds.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_water_defaults(table) return rp_sounds.node_sound_water_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_lava_defaults(table) function sound_api.node_sound_lava_defaults(soundtable)
--s/lava/water --s/lava/water
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_water_defaults(table) return default.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_lava_defaults(table) return mcl_sounds.node_sound_lava_defaults(soundtable)
--s/lava/water --s/lava/water
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_water_defaults(table) return nodes_nature.node_sound_water_defaults(soundtable)
elseif minetest.get_modpath("hades_sounds") then elseif minetest.get_modpath("hades_sounds") then
return hades_sounds.node_sound_lava_defaults(table) return hades_sounds.node_sound_lava_defaults(soundtable)
--s/lava/water --s/lava/water
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_water_defaults(table) return rp_sounds.node_sound_water_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_snow_defaults(table) function sound_api.node_sound_snow_defaults(soundtable)
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_snow_defaults(table) return default.node_sound_snow_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_snow_defaults(table) return mcl_sounds.node_sound_snow_defaults(soundtable)
elseif minetest.get_modpath("ks_sounds") then elseif minetest.get_modpath("ks_sounds") then
return ks.node_sound_snow_default(table) return ks.node_sound_snow_default(soundtable)
elseif minetest.get_modpath("nodes_nature") then elseif minetest.get_modpath("nodes_nature") then
return nodes_nature.node_sound_snow_defaults(table) return nodes_nature.node_sound_snow_defaults(soundtable)
elseif minetest.get_modpath("fl_topsoil") then elseif minetest.get_modpath("fl_topsoil") then
return fl_topsoil.sounds.snow(table) return fl_topsoil.sounds.snow(soundtable)
elseif minetest.get_modpath("rp_sounds") then elseif minetest.get_modpath("rp_sounds") then
return rp_sounds.node_sound_snow_defaults(table) return rp_sounds.node_sound_snow_defaults(soundtable)
else else
return table return soundtable
end end
end end
function sound_api.node_sound_wool_defaults(table) function sound_api.node_sound_wool_defaults(soundtable)
--s/wool/default --s/wool/default
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
return default.node_sound_defaults(table) return default.node_sound_defaults(soundtable)
elseif minetest.get_modpath("mcl_sounds") then elseif minetest.get_modpath("mcl_sounds") then
return mcl_sounds.node_sound_wool_defaults(table) return mcl_sounds.node_sound_wool_defaults(soundtable)
else else
return table return soundtable
end end
end end