A mod that aims to facilitate other mods to be game agnostic by handling sounds and crafting.
Go to file
wsor4035 e0e21f9a6c
Merge pull request #3 from mt-mods/dependabot/submodules/sound_api_core-39c02a9
Bump sound_api_core from `6956e49` to `39c02a9`
2022-04-26 12:43:00 -04:00
.github add luacheck workflow 2022-02-27 11:03:47 -05:00
sound_api_core@39c02a99de Bump sound_api_core from 6956e49 to 39c02a9 2022-04-26 16:30:48 +00:00
.gitmodules initial commit 2022-01-18 22:29:18 -05:00
.luacheckrc add agnostic way to use mod 2022-01-29 20:46:20 -05:00
init.lua add hades support, mod.conf, and bugfix 2022-02-27 11:02:10 -05:00
LICENSE initial commit 2022-01-18 22:29:18 -05:00
mod.conf add hades support, mod.conf, and bugfix 2022-02-27 11:02:10 -05:00
README.md close https://github.com/mt-mods/sound_api/issues/2 2022-01-29 21:07:33 -05:00

Sound API

This mod is a wrapper for sound api library.

Usage of the sound api

Option 1: embed

You can insert the sound api library directly into your mod as a submodule and use the following to load it.

local sound_api = dofile(modpath .. "/sound_api_core/init.lua")

additionally the author recommends that you use dependabot(github) or similar to help you keep the submodule up to date.

Option 2: Agnostically depend

You can do this by using a custom field in your node def instead of the sounds key.

minetest.register_node(nodename, {
    ...
    _sound_def = {
        key = "",
        input = {},
    },
    ...
})

where:

  • key: string name of the field from the sound api you want to use, for example node_sound_stone_defaults
  • input: table input of fields you want passed to the key field, used to override specific sounds.

Option 3: Hard depend

add this mod to your mod.confs depends and directly call the sound_api as follows

minetest.register_node(nodename, {
    ...
    sounds = sound_api.node_sound_stone_defaults(input)
    ...
})
  • input: optional table to override some or all of returned values