Skip to content

Commit

Permalink
Clarify documentation of minetest.get_modpath and minetest.get_modnam…
Browse files Browse the repository at this point in the history
…es (#10771)
  • Loading branch information
OgelGames committed Jan 2, 2021
1 parent 92aac69 commit ad58fb2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions doc/lua_api.txt
Expand Up @@ -4327,11 +4327,14 @@ Utilities

* `minetest.get_current_modname()`: returns the currently loading mod's name,
when loading a mod.
* `minetest.get_modpath(modname)`: returns e.g.
`"/home/user/.minetest/usermods/modname"`.
* Useful for loading additional `.lua` modules or static data from mod
* `minetest.get_modnames()`: returns a list of installed mods
* Return a list of installed mods, sorted alphabetically
* `minetest.get_modpath(modname)`: returns the directory path for a mod,
e.g. `"/home/user/.minetest/usermods/modname"`.
* Returns nil if the mod is not enabled or does not exist (not installed).
* Works regardless of whether the mod has been loaded yet.
* Useful for loading additional `.lua` modules or static data from a mod,
or checking if a mod is enabled.
* `minetest.get_modnames()`: returns a list of enabled mods, sorted alphabetically.
* Does not include disabled mods, even if they are installed.
* `minetest.get_worldpath()`: returns e.g. `"/home/user/.minetest/world"`
* Useful for storing custom data
* `minetest.is_singleplayer()`
Expand Down

0 comments on commit ad58fb2

Please sign in to comment.