Document rp_sounds API
This commit is contained in:
parent
2b55d4cbbc
commit
a3d434de06
@ -52,6 +52,7 @@ Mods with documented APIs:
|
||||
* `rp_partialblocks`: Register partial blocks (slabs, stairs)
|
||||
* `rp_player`: Player model handling, model animation, textures
|
||||
* `rp_player_effects`: Add player effects (required if you want to modify player physics)
|
||||
* `rp_sounds`: Node sounds
|
||||
* `rp_util`: Helper functions for Repixture
|
||||
* `tt`: Custom tooltips
|
||||
|
||||
|
44
mods/rp_sounds/API.md
Normal file
44
mods/rp_sounds/API.md
Normal file
@ -0,0 +1,44 @@
|
||||
## Functions
|
||||
|
||||
This mod gives you the node sounds. You need these helper
|
||||
functions to give nodes sounds.
|
||||
|
||||
### Basic function syntax
|
||||
|
||||
Every function returns a value that you can use to set the node's
|
||||
`sounds` argument with. You can choose between stone, dirt, sand,
|
||||
and other sounds. There is an optional argument `table` in which
|
||||
you can override the default sound table returned by this
|
||||
function. The syntax of this table is the same as for the node's
|
||||
`sound` field in the node registration function, with the difference
|
||||
that the keys included in this table will be the ones to override.
|
||||
|
||||
Examples:
|
||||
|
||||
rp_sounds.node_sound_wood_defaults()
|
||||
|
||||
Returns a sound definition for wooden node sounds.
|
||||
|
||||
|
||||
|
||||
rp_sounds.node_sound_dirt_defaults({
|
||||
footstep = {name="default_hard_footstep", gain=0.6}
|
||||
})
|
||||
|
||||
Returns a sound definition with dirt sounds, except the footstep
|
||||
sound was changed to `default_hard_footstep`.
|
||||
|
||||
|
||||
### List of functions
|
||||
|
||||
These are the available functions:
|
||||
|
||||
* `rp_sounds.node_sound_defaults(table)`: Default/fallback sounds
|
||||
* `rp_sounds.node_sound_stone_defaults(table)`: Stone
|
||||
* `rp_sounds.node_sound_dirt_defaults(table)`: Dirt
|
||||
* `rp_sounds.node_sound_sand_defaults(table)`: Sand
|
||||
* `rp_sounds.node_sound_wood_defaults(table)`: Wood, tree, etc.
|
||||
* `rp_sounds.node_sound_leaves_defaults(table)`: Leaves
|
||||
* `rp_sounds.node_sound_glass_defaults(table)`: Glass
|
||||
* `rp_sounds.node_sound_snow_defaults(table)`: Snow
|
||||
* `rp_sounds.node_sound_water_defaults(table)`: Water
|
@ -1,6 +1,8 @@
|
||||
Repixure mod: rp_sounds
|
||||
=======================
|
||||
Node sound functions for Repixture
|
||||
Node sound functions for Repixture.
|
||||
|
||||
Developers: See `API.md` for instructions.
|
||||
|
||||
Sound licenses:
|
||||
* Water sounds:
|
||||
|
Loading…
x
Reference in New Issue
Block a user