mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Add minetest.unregister_item and minetest.register_alias_force
This commit is contained in:
parent
7eacdc7bb8
commit
aa33166386
8 changed files with 121 additions and 3 deletions
|
@ -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)`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue