Extract logging.lua & registration/environment.lua into ./core_namespace/. Relates to #1

This commit is contained in:
Alexander Chibrikin
2026-01-21 18:57:22 +03:00
parent c82bed2046
commit 3eb0f97115
3 changed files with 147 additions and 123 deletions

View File

@@ -305,134 +305,14 @@ function core.translate(textdomain, str, ...) end
-- Logging:
--- * Equivalent to `core.log(table.concat({...}, "\t"))`
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4458-L4459)
--- @param ... any
function core.debug(...) end
--- @alias LogLevel
--- | "none"
--- | "error"
--- | "warning"
--- | "action"
--- | "info"
--- | "verbose"
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4460-L4462)
---
--- @overload fun(text:string)
--- @param level? LogLevel # [Optional] is one of `"none"`, `"error"`, `"warning"`, `"action"`, `"info"`, or `"verbose"`. Default is `"none"`.
--- @param text string
function core.log(level, text) end
-- see ./core_namespace/logging.lua
-- Registration functions:
-- Environment:
-- see ./core_namespace/registration/environment.lua
--- @param name string technical node name ("<mod>:<node>").
--- @param node_definition NodeDefinition table with node definition properties.
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4471-L4471)
function core.register_node(name, node_definition) end
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4472-L4472)
--- @param item_definition ItemDefinition
function core.register_craftitem(name, item_definition) end
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4473-L4473)
--- @param name string
--- @param item_definition ItemDefinition
function core.register_tool(name, item_definition) end
--- * Overrides fields of an item registered with register_node/tool/craftitem.
--- * Note: Item must already be defined, (opt)depend on the mod defining it.
--- * Example: `core.override_item("default:mese",
--- {light_source=core.LIGHT_MAX})`
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4474-L4478)
--- @param name string
--- @param redefinition ItemDefinition|NodeDefinition
function core.override_item(name, redefinition) end
--- * Unregisters the item from the engine, and deletes the entry with key
--- `name` from `core.registered_items` and from the associated item table
--- according to its nature: `core.registered_nodes`, etc.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4479-L4482)
function core.unregister_item(name) end
--- @param name string
--- @param entity_definition EntityDefinition
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4483-L4483)
function core.register_entity(name, entity_definition) end
--- @param abm_definition ABMDefinition
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4484-L4484)
function core.register_abm(abm_definition) end
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4485-L4485)
function core.register_lbm(lbm_definition) end
--- * Also use this to set the 'mapgen aliases' needed in a game for the core
--- mapgens. See [Mapgen aliases] section above.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4486-L4488)
---@param alias string @itemstring
---@param original_name string @itemstring
function core.register_alias(alias, original_name) end
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4489-L4489)
function core.register_alias_force(alias, original_name) end
--- * Returns an integer object handle uniquely identifying the registered
--- ore on success.
--- * The order of ore registrations determines the order of ore generation.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4490-L4493)
function core.register_ore(ore_definition) end
--- * Returns an integer object handle uniquely identifying the registered
--- biome on success. To get the biome ID, use `core.get_biome_id`.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4494-L4496)
function core.register_biome(biome_definition) end
--- * Unregisters the biome from the engine, and deletes the entry with key
--- `name` from `core.registered_biomes`.
--- * Warning: This alters the biome to biome ID correspondences, so any
--- decorations or ores using the 'biomes' field must afterwards be cleared
--- and re-registered.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4497-L4502)
function core.unregister_biome(name) end
--- * Returns an integer object handle uniquely identifying the registered
--- decoration on success. To get the decoration ID, use
--- `core.get_decoration_id`.
--- * The order of decoration registrations determines the order of decoration
--- generation.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4503-L4508)
function core.register_decoration(decoration_definition) end
--- * Returns an integer object handle uniquely identifying the registered
--- schematic on success.
--- * If the schematic is loaded from a file, the `name` field is set to the
--- filename.
--- * If the function is called when loading the mod, and `name` is a relative
--- path, then the current mod path will be prepended to the schematic
--- filename.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4509-L4516)
function core.register_schematic(schematic_definition) end
--- * Clears all biomes currently registered.
--- * Warning: Clearing and re-registering biomes alters the biome to biome ID
--- correspondences, so any decorations or ores using the 'biomes' field must
--- afterwards be cleared and re-registered.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4517-L4521)
function core.clear_registered_biomes() end
--- * Clears all decorations currently registered.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4522-L4523)
function core.clear_registered_decorations() end
--- * Clears all ores currently registered.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4524-L4525)
function core.clear_registered_ores() end
--- * Clears all schematics currently registered.
---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4526-L4527)
function core.clear_registered_schematics() end
-- Gameplay:
--- * Check recipe table syntax for different types below.