diff options
author | paly2 <plangrognet@laposte.net> | 2016-07-10 15:15:43 +0200 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2016-09-08 03:26:52 -0400 |
commit | aa33166386f737f213f1f3005ffd6a6adfd2d97f (patch) | |
tree | 6ddbec97ff34fd231a7cb23e70d1dc7dce6049cb /doc/lua_api.txt | |
parent | 7eacdc7bb8ec8f8b06b5e0b2464af219e623cd56 (diff) | |
download | minetest-aa33166386f737f213f1f3005ffd6a6adfd2d97f.tar.gz minetest-aa33166386f737f213f1f3005ffd6a6adfd2d97f.tar.bz2 minetest-aa33166386f737f213f1f3005ffd6a6adfd2d97f.zip |
Add minetest.unregister_item and minetest.register_alias_force
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r-- | doc/lua_api.txt | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 579fe796e..da9ebb9f1 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -208,11 +208,17 @@ when registering it. The `:` prefix can also be used for maintaining backwards compatibility. ### Aliases -Aliases can be added by using `minetest.register_alias(name, convert_to)`. +Aliases can be added by using `minetest.register_alias(name, convert_to)` or +`minetest.register_alias_force(name, convert_to). This will make Minetest to convert things called name to things called `convert_to`. +The only difference between `minetest.register_alias` and +`minetest.register_alias_force` is that if an item called `name` exists, +`minetest.register_alias` will do nothing while +`minetest.register_alias_force` will unregister it. + This can be used for maintaining backwards compatibility. This can be also used for setting quick access names for things, e.g. if @@ -464,6 +470,11 @@ the global `minetest.registered_*` tables. * `minetest.register_craftitem(name, item definition)` * added to `minetest.registered_items[name]` +* `minetest.unregister_item(name)` + * Unregisters the item name from engine, and deletes the entry with key + * `name` from `minetest.registered_items` and from the associated item + * table according to its nature: minetest.registered_nodes[] etc + * `minetest.register_biome(biome definition)` * returns an integer uniquely identifying the registered biome * added to `minetest.registered_biome` with the key of `biome.name` @@ -1883,7 +1894,9 @@ Call these functions only at load time! * `minetest.register_node(name, node definition)` * `minetest.register_tool(name, item definition)` * `minetest.register_craftitem(name, item definition)` +* `minetest.unregister_item(name)` * `minetest.register_alias(name, convert_to)` +* `minetest.register_alias_force(name, convert_to)` * `minetest.register_craft(recipe)` * Check recipe table syntax for different types below. * `minetest.clear_craft(recipe)` |