]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - doc/lua_api.txt
Update Lua API documentation to include minetest.get_modnames()
[dragonfireclient.git] / doc / lua_api.txt
index 823b4b825eb3c60e8a01840ae9ccb7b74842e3a3..d5797d17193a4936c632c8221b1d1a6ef89df566 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Modding API Reference 0.4.dev
+Minetest Lua Modding API Reference 0.4.0
 ==========================================
 More information at http://c55.me/minetest/
 
@@ -718,6 +718,8 @@ minetest namespace reference
 minetest.get_current_modname() -> string
 minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
 ^ Useful for loading additional .lua modules or static data from mod
+minetest.get_modnames() -> list of installed mods
+^ Return a list of installed mods, sorted alphabetically
 minetest.get_worldpath() -> eg. "/home/user/.minetest/world"
 ^ Useful for storing custom data
 minetest.is_singleplayer()
@@ -829,6 +831,13 @@ minetest.get_craft_result(input) -> output, decremented_input
 ^ output.item = ItemStack, if unsuccessful: empty ItemStack
 ^ output.time = number, if unsuccessful: 0
 ^ decremented_input = like input
+minetest.get_craft_recipe(output) -> input
+^ output is a node or item type such as 'default:torch'
+^ input.method = 'normal' or 'cooking' or 'fuel'
+^ input.width = for example 3
+^ input.items = for example { stack 1, stack 2, stack 3, stack 4,
+                              stack 5, stack 6, stack 7, stack 8, stack 9 }
+^ input.items = nil if no recipe found
 
 Defaults for the on_* item definition functions:
 (These return the leftover itemstack)