mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-21 18:11:11 +00:00
builtin: Unify register wrapper functions and wrap clear_registered_* functions too
This commit is contained in:
parent
0fd1ee0380
commit
a4a6cc8eb1
2 changed files with 38 additions and 18 deletions
|
@ -417,10 +417,20 @@ the global `minetest.registered_*` tables.
|
|||
* added to `minetest.registered_items[name]`
|
||||
|
||||
* `minetest.register_ore(ore definition)`
|
||||
* added to `minetest.registered_ores`
|
||||
* returns an integer uniquely identifying the registered ore
|
||||
* added to `minetest.registered_ores` with the key of `ore.name`
|
||||
* if `ore.name` is nil, the key is the returned ID
|
||||
|
||||
* `minetest.register_decoration(decoration definition)`
|
||||
* added to `minetest.registered_decorations`
|
||||
* returns an integer uniquely identifying the registered decoration
|
||||
* added to `minetest.registered_decorations` with the key of `decoration.name`
|
||||
* if `decoration.name` is nil, the key is the returned ID
|
||||
|
||||
* `minetest.clear_registered_ores()`
|
||||
* clears all ores currently registered
|
||||
|
||||
* `minetest.clear_registered_decorations()`
|
||||
* clears all decorations currently registered
|
||||
|
||||
Note that in some cases you will stumble upon things that are not contained
|
||||
in these tables (e.g. when a mod has been removed). Always check for
|
||||
|
@ -1679,6 +1689,9 @@ Call these functions only at load time!
|
|||
* Note: Item must already be defined, (opt)depend on the mod defining it.
|
||||
* Example: `minetest.override_item("default:mese", {light_source=LIGHT_MAX})`
|
||||
|
||||
* `minetest.clear_registered_ores()`
|
||||
* `minetest.clear_registered_decorations()`
|
||||
|
||||
### Global callback registration functions
|
||||
Call these functions only at load time!
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue