From 71832e58386a525c4116853b747f9caf6f4f751b Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Wed, 21 Jan 2026 11:01:25 +0300 Subject: [PATCH] Change namespace `minetest.` -> `core.`. --- classes/InvRef.lua | 4 +- classes/MetaDataRef/NodeMetaRef.lua | 2 +- classes/MetaDataRef/StorageRef.lua | 2 +- classes/ObjectRef/Entity.lua | 2 +- classes/Settings.lua | 8 +- classes/VoxelManip.lua | 8 +- core_namespace.lua | 715 +++++++++--------- core_namespace/utilities.lua | 62 +- .../AuthenticationHandlerDefinition.lua | 2 +- definitions/ChatCommandDefinition.lua | 3 +- definitions/EntityDefinition.lua | 6 +- definitions/ItemDefinition.lua | 20 +- definitions/NodeDefinition.lua | 20 +- definitions/ObjectProperties.lua | 6 +- specs/SimpleSoundSpec.lua | 2 +- specs/TextureModifier.lua | 2 +- 16 files changed, 433 insertions(+), 431 deletions(-) diff --git a/classes/InvRef.lua b/classes/InvRef.lua index f760ee2..c10a7c2 100644 --- a/classes/InvRef.lua +++ b/classes/InvRef.lua @@ -79,11 +79,11 @@ function InvRef:contains_item(list_name, stack, match_meta) end --- --- @return ItemStack function InvRef:remove_item(list_name, stack, match_meta) end ---- returns a location compatible to `minetest.get_inventory(location)`. e.g. +--- returns a location compatible to `core.get_inventory(location)`. e.g. --- * `{type="player", name="celeron55"}` --- * `{type="node", pos={x=, y=, z=}}` --- * `{type="detached", name="creative"}` --- returns `{type="undefined"}` in case location is not known. ---- @see minetest.get_inventory +--- @see core.get_inventory --- @return table function InvRef:get_location() end diff --git a/classes/MetaDataRef/NodeMetaRef.lua b/classes/MetaDataRef/NodeMetaRef.lua index 3e8ee47..b190ce0 100644 --- a/classes/MetaDataRef/NodeMetaRef.lua +++ b/classes/MetaDataRef/NodeMetaRef.lua @@ -2,7 +2,7 @@ --- Node metadata: reference extra data and functionality stored in a node. ---- Can be obtained via `minetest.get_meta(pos)`. +--- Can be obtained via `core.get_meta(pos)`. --- --- @class NodeMetaRef: MetaDataRef NodeMetaRef = {} diff --git a/classes/MetaDataRef/StorageRef.lua b/classes/MetaDataRef/StorageRef.lua index da8af49..bbaa527 100644 --- a/classes/MetaDataRef/StorageRef.lua +++ b/classes/MetaDataRef/StorageRef.lua @@ -1,5 +1,5 @@ --- Mod metadata: per mod metadata, saved automatically. ---- Can be obtained via `minetest.get_mod_storage()` during load time. +--- Can be obtained via `core.get_mod_storage()` during load time. --- --- WARNING: This storage backend is incapable of saving raw binary data due --- to restrictions of JSON. diff --git a/classes/ObjectRef/Entity.lua b/classes/ObjectRef/Entity.lua index 5b2d119..d77afa1 100644 --- a/classes/ObjectRef/Entity.lua +++ b/classes/ObjectRef/Entity.lua @@ -1,4 +1,4 @@ ---- @diagnostic disable: missing-return +--- @meta ---@class Entity: ObjectRef diff --git a/classes/Settings.lua b/classes/Settings.lua index 6fe53cb..6c7d641 100644 --- a/classes/Settings.lua +++ b/classes/Settings.lua @@ -3,11 +3,11 @@ --- An interface to read config files in the format of `minetest.conf`. --- ---- `minetest.settings` is a `Settings` instance that can be used to access the +--- `core.settings` is a `Settings` instance that can be used to access the --- main config file (`minetest.conf`). Instances for other config files can be --- created via `Settings(filename)`. --- ---- Engine settings on the `minetest.settings` object have internal defaults that +--- Engine settings on the `core.settings` object have internal defaults that --- will be returned if a setting is unset. --- The engine does *not* (yet) read `settingtypes.txt` for this purpose. This --- means that no defaults will be returned for mod settings. @@ -50,7 +50,7 @@ function Settings:get_np_group(key) end function Settings:get_flags(key) end --- * Setting names can't contain whitespace or any of `="{}#`. --- * Setting values can't contain the sequence `\n"""`. ---- * Setting names starting with "secure." can't be set on the main settings object (`minetest.settings`). +--- * Setting names starting with "secure." can't be set on the main settings object (`core.settings`). --- @param key string --- @param value string function Settings:set(key, value) end @@ -73,7 +73,7 @@ function Settings:get_names() end --- * Returns a boolean indicating whether `key` exists. --- * In contrast to the various getter functions, `has()` doesn't consider any default values. ---- * This means that on the main settings object (`minetest.settings`), `get(key)` might return a value even if `has(key)` returns `false`. +--- * This means that on the main settings object (`core.settings`), `get(key)` might return a value even if `has(key)` returns `false`. --- @param key string --- @return boolean function Settings:has(key) end diff --git a/classes/VoxelManip.lua b/classes/VoxelManip.lua index 98b5e5b..16a094b 100644 --- a/classes/VoxelManip.lua +++ b/classes/VoxelManip.lua @@ -16,7 +16,7 @@ function VoxelManip:read_from_map(position1, position2) end --- * if `light` is `true`, then lighting is automatically recalculated. --- The default value is `true`. --- If `light` is `false`, no light calculations happen, and you should correct ---- all modified blocks with `minetest.fix_light()` as soon as possible. +--- all modified blocks with `core.fix_light()` as soon as possible. --- Keep in mind that modifying the map where light is incorrect can cause more lighting bugs. --- @param light boolean? Default: `true` function VoxelManip:write_to_map(light) end @@ -50,7 +50,7 @@ function VoxelManip:set_data(data) end --- function VoxelManip:update_map() end --- Set the lighting within the `VoxelManip` to a uniform value. --- * `light` is a table, `{day=<0...15>, night=<0...15>}` ---- * To be used only by a `VoxelManip` object from `minetest.get_mapgen_object`. +--- * To be used only by a `VoxelManip` object from `core.get_mapgen_object`. --- * (`p1`, `p2`) is the area in which lighting is set, defaults to the whole area if left out. function VoxelManip:set_lighting(light, p1, p2) end @@ -83,7 +83,7 @@ function VoxelManip:set_param2_data(param2_data) end --- Calculate lighting within the `VoxelManip`. --- * To be used only by a `VoxelManip` object from ---- `minetest.get_mapgen_object`. +--- `core.get_mapgen_object`. --- * (`p1`, `p2`) is the area in which lighting is set, defaults to the whole --- area if left out or nil. For almost all uses these should be left out --- or nil to use the default. @@ -102,7 +102,7 @@ function VoxelManip:calc_lighting(p1, p2, propagate_shadow) end function VoxelManip:update_liquids() end --- Returns `true` or `false` if the data in the voxel --- manipulator had been modified since the last read from map, due to a call to ---- `minetest.set_data()` on the loaded area elsewhere. +--- `core.set_data()` on the loaded area elsewhere. --- @return boolean function VoxelManip:was_modified() end diff --git a/core_namespace.lua b/core_namespace.lua index 63ce0dc..d89299c 100644 --- a/core_namespace.lua +++ b/core_namespace.lua @@ -78,19 +78,19 @@ minetest = core --- --- @param color ColorString --- @return string -function minetest.get_color_escape_sequence(color) end +function core.get_color_escape_sequence(color) end --- * Equivalent to: ---- `minetest.get_color_escape_sequence(color) .. +--- `core.get_color_escape_sequence(color) .. --- message .. ---- minetest.get_color_escape_sequence("#ffffff")` +--- core.get_color_escape_sequence("#ffffff")` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3110-L3114) --- --- @param color ColorString --- @param message string --- @return string -function minetest.colorize(color, message) end +function core.colorize(color, message) end --- * `color` is a ColorString --- * The escape sequence sets the background of the whole text element to @@ -100,21 +100,21 @@ function minetest.colorize(color, message) end --- --- @param color ColorString --- @return string -function minetest.get_background_escape_sequence(color) end +function core.get_background_escape_sequence(color) end --- * Removes foreground colors added by `get_color_escape_sequence`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3119-L3120) --- @param str string --- @return string -function minetest.strip_foreground_colors(str) end +function core.strip_foreground_colors(str) end --- * Removes background colors added by `get_background_escape_sequence`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3121-L3122) --- --- @param str string --- @return string -function minetest.strip_background_colors(str) end +function core.strip_background_colors(str) end --- * Removes all color escape sequences. --- @@ -122,7 +122,7 @@ function minetest.strip_background_colors(str) end --- --- @param str string --- @return string -function minetest.strip_colors(str) end +function core.strip_colors(str) end @@ -143,7 +143,7 @@ function minetest.strip_colors(str) end --- @param limit number --- @param as_table? boolean --- @return string|table -function minetest.wrap_text(str, limit, as_table) end +function core.wrap_text(str, limit, as_table) end --- returns string `"(X,Y,Z)"` --- * `pos`: table {x=X, y=Y, z=Z} @@ -156,7 +156,7 @@ function minetest.wrap_text(str, limit, as_table) end --- @param pos Position --- @param decimal_places? number --- @return string -function minetest.pos_to_string(pos, decimal_places) end +function core.pos_to_string(pos, decimal_places) end --- returns a position or `nil` --- * Same but in reverse. @@ -166,7 +166,7 @@ function minetest.pos_to_string(pos, decimal_places) end --- --- @param string string --- @return Position -function minetest.string_to_pos(string) end +function core.string_to_pos(string) end --- returns two positions --- * Converts a string representing an area box into two positions @@ -177,13 +177,13 @@ function minetest.string_to_pos(string) end --- can use the tilde notation for relative positions --- * Tilde notation: "~": Relative coordinate --- "~": Relative coordinate plus ---- * Example: `minetest.string_to_area("(1,2,3) (~5,~-5,~)", {x=10,y=10,z=10})` +--- * Example: `core.string_to_area("(1,2,3) (~5,~-5,~)", {x=10,y=10,z=10})` --- returns `{x=1,y=2,z=3}, {x=15,y=5,z=10}` --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.6.1/doc/lua_api.txt#L3581-L3590) --- @param area_string string --- @param relative_to? Position --- @return Position, Position -function minetest.string_to_area(area_string, relative_to) end +function core.string_to_area(area_string, relative_to) end --- returns a string --- * escapes the characters "[", "]", "\", "," and ";", which can not be used @@ -192,26 +192,26 @@ function minetest.string_to_area(area_string, relative_to) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3262-L3264) --- @param string string --- @return string -function minetest.formspec_escape(string) end +function core.formspec_escape(string) end --- * returns true if passed 'y', 'yes', 'true' or a number that isn't zero. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3265-L3266) --- @param arg any --- @return boolean -function minetest.is_yes(arg) end +function core.is_yes(arg) end --- * returns true when the passed number represents NaN. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3267-L3268) --- @param arg any --- @return boolean -function minetest.is_nan(arg) end +function core.is_nan(arg) end --- * returns time with microsecond precision. May not return wall time. --- * This value might overflow on certain 32-bit systems! --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3269-L3271) ---@return number -function minetest.get_us_time() end +function core.get_us_time() end --- returns a position. --- * returns the exact position on the surface of a pointed node --- @@ -219,7 +219,7 @@ function minetest.get_us_time() end --- @param placer Player|ObjectRef --- @param pointed_thing pointed_thing --- @return Position -function minetest.pointed_thing_to_face_pos(placer, pointed_thing) end +function core.pointed_thing_to_face_pos(placer, pointed_thing) end --- Simulates a tool that digs a node. --- Returns a table with the following fields: @@ -233,7 +233,7 @@ function minetest.pointed_thing_to_face_pos(placer, pointed_thing) end --- @param groups table Table of the node groups of the node that would be dug --- @param tool_capabilities table Tool capabilities table of the tool --- @return {diggable: boolean, time: number, wear: number} -function minetest.get_dig_params(groups, tool_capabilities) end +function core.get_dig_params(groups, tool_capabilities) end --- Simulates an item that punches an object. --- Returns a table with the following fields: @@ -246,19 +246,19 @@ function minetest.get_dig_params(groups, tool_capabilities) end --- @param tool_capabilities table Tool capabilities table of the item --- @param time_from_last_punch? number [Optional] time in seconds since last punch action --- @return {hp: number, wear: number} -function minetest.get_hit_params(groups, tool_capabilities , time_from_last_punch) end +function core.get_hit_params(groups, tool_capabilities , time_from_last_punch) end -- Translations --- is a simple wrapper around ---- `minetest.translate`, and `minetest.get_translator(textdomain)(str, ...)` is ---- equivalent to `minetest.translate(textdomain, str, ...)`. +--- `core.translate`, and `core.get_translator(textdomain)(str, ...)` is +--- equivalent to `core.translate(textdomain, str, ...)`. --- It is intended to be used in the following way, so that it avoids verbose ---- repetitions of `minetest.translate`: +--- repetitions of `core.translate`: --- ---- local S = minetest.get_translator(textdomain) +--- local S = core.get_translator(textdomain) --- S(str, ...) --- --- As an extra commodity, if `textdomain` is nil, it is assumed to be "" instead. @@ -267,7 +267,7 @@ function minetest.get_hit_params(groups, tool_capabilities , time_from_last_punc --- --- @param text_domain string --- @return fun(str: string, ...):string -function minetest.get_translator(text_domain) end +function core.get_translator(text_domain) end --- translates the string `str` with --- the given `textdomain` for disambiguation. The textdomain must match the --- textdomain specified in the translation file in order to get the string @@ -278,12 +278,12 @@ function minetest.get_translator(text_domain) end --- This function must be given a number of arguments equal to the number of --- arguments the translated string expects. --- Arguments are literal strings -- they will not be translated, so if you want ---- them to be, they need to come as outputs of `minetest.translate` as well. +--- them to be, they need to come as outputs of `core.translate` as well. --- --- For instance, suppose we want to translate "@1 Wool" with "@1" being replaced --- by the translation of "Red". We can do the following: --- ---- local S = minetest.get_translator() +--- local S = core.get_translator() --- S("@1 Wool", S("Red")) --- --- This will be displayed as "Red Wool" on old clients and on clients that do @@ -300,17 +300,17 @@ function minetest.get_translator(text_domain) end --- @param textdomain string --- @param str string --- @return string -function minetest.translate(textdomain, str, ...) end +function core.translate(textdomain, str, ...) end -- Logging: ---- * Equivalent to `minetest.log(table.concat({...}, "\t"))` +--- * 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 minetest.debug(...) end +function core.debug(...) end --- @alias LogLevel --- | "none" @@ -325,7 +325,7 @@ function minetest.debug(...) end --- @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 minetest.log(level, text) end +function core.log(level, text) end @@ -336,74 +336,74 @@ function minetest.log(level, text) end --- @param name string technical node name (":"). --- @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 minetest.register_node(name, node_definition) end +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 minetest.register_craftitem(name, item_definition) end +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 minetest.register_tool(name, item_definition) end +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: `minetest.override_item("default:mese", ---- {light_source=minetest.LIGHT_MAX})` +--- * 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 minetest.override_item(name, redefinition) end +function core.override_item(name, redefinition) end --- * Unregisters the item from the 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. +--- `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 minetest.unregister_item(name) end +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 minetest.register_entity(name, entity_definition) end +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 minetest.register_abm(abm_definition) end +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 minetest.register_lbm(lbm_definition) end +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 minetest.register_alias(alias, original_name) end +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 minetest.register_alias_force(alias, original_name) end +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 minetest.register_ore(ore_definition) end +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 `minetest.get_biome_id`. +--- 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 minetest.register_biome(biome_definition) end +function core.register_biome(biome_definition) end --- * Unregisters the biome from the engine, and deletes the entry with key ---- `name` from `minetest.registered_biomes`. +--- `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 minetest.unregister_biome(name) end +function core.unregister_biome(name) end --- * Returns an integer object handle uniquely identifying the registered --- decoration on success. To get the decoration ID, use ---- `minetest.get_decoration_id`. +--- `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 minetest.register_decoration(decoration_definition) end +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 @@ -413,36 +413,36 @@ function minetest.register_decoration(decoration_definition) end --- filename. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4509-L4516) -function minetest.register_schematic(schematic_definition) end +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 minetest.clear_registered_biomes() end +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 minetest.clear_registered_decorations() end +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 minetest.clear_registered_ores() end +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 minetest.clear_registered_schematics() end +function core.clear_registered_schematics() end -- Gameplay: --- * Check recipe table syntax for different types below. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4531-L4532) -function minetest.register_craft(recipe) end +function core.register_craft(recipe) end --- * Will erase existing craft based either on output item or on input recipe. --- * Specify either output or input only. If you specify both, input will be --- ignored. For input use the same recipe table syntax as for ---- `minetest.register_craft(recipe)`. For output specify only the item, +--- `core.register_craft(recipe)`. For output specify only the item, --- without a quantity. --- * Returns false if no erase candidate could be found, otherwise returns true. --- * **Warning**! The type field ("shaped", "cooking" or any other) will be @@ -450,19 +450,19 @@ function minetest.register_craft(recipe) end --- from the crafting method. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4533-L4542) -function minetest.clear_craft(recipe) end +function core.clear_craft(recipe) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4543-L4543) --- @param cmd string --- @param chatcommand_definition ChatCommandDefinition -function minetest.register_chatcommand(cmd, chatcommand_definition) end +function core.register_chatcommand(cmd, chatcommand_definition) end --- * Overrides fields of a chatcommand registered with `register_chatcommand`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4544-L4545) -function minetest.override_chatcommand(name, redefinition) end +function core.override_chatcommand(name, redefinition) end --- * Unregisters a chatcommands registered with `register_chatcommand`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4546-L4547) -function minetest.unregister_chatcommand(name) end +function core.unregister_chatcommand(name) end --- * `definition` can be a description or a definition table (see [Privilege --- definition]). --- * If it is a description, the priv will be granted to singleplayer and admin @@ -473,25 +473,25 @@ function minetest.unregister_chatcommand(name) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4548-L4554) --- @param name string --- @param definition string|PrivilegeDefinition -function minetest.register_privilege(name, definition) end +function core.register_privilege(name, definition) end --- * Registers an auth handler that overrides the builtin one. --- * This function can be called by a single mod once only. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4555-L4557) -function minetest.register_authentication_handler(authentication_handler_definition) end +function core.register_authentication_handler(authentication_handler_definition) end -- Global callback registration functions: --- * Called every server step, usually interval of 0.1s --- * `delta_time` is the time since last execution in seconds. --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4564-L4565) --- @param callback fun(delta_time:number) -function minetest.register_globalstep(callback) end +function core.register_globalstep(callback) end --- * Called after mods have finished loading and before the media is cached or the --- aliases handled. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4566-L4568) --- @param callback fun() -function minetest.register_on_mods_loaded(callback) end +function core.register_on_mods_loaded(callback) end --- * Called before server shutdown --- * **Warning**: If the server terminates abnormally (i.e. crashes), the --- registered callbacks **will likely not be run**. Data should be saved at @@ -499,7 +499,7 @@ function minetest.register_on_mods_loaded(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4569-L4573) --- @param callback fun() -function minetest.register_on_shutdown(callback) end +function core.register_on_shutdown(callback) end --- * Called when a node has been placed --- * If return `true` no item is taken from `itemstack` --- * `placer` may be any valid ObjectRef or nil. @@ -508,19 +508,19 @@ function minetest.register_on_shutdown(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4574-L4579) --- @param callback fun(pos, newnode, placer, oldnode, itemstack, pointed_thing) -function minetest.register_on_placenode(callback) end +function core.register_on_placenode(callback) end --- * Called when a node has been dug. --- * **Not recommended**; Use `on_destruct` or `after_dig_node` in node --- definition whenever possible. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4580-L4583) --- @param callback fun(pos, oldnode, digger) -function minetest.register_on_dignode(callback) end +function core.register_on_dignode(callback) end --- * Called when a node is punched --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4584-L4585) --- @param callback fun(pos, node, puncher, pointed_thing) -function minetest.register_on_punchnode(callback) end +function core.register_on_punchnode(callback) end --- * Called after the engine mapgen finishes a chunk but before it is written to the map. --- * Chunk data resides in `vmanip`. Other parts of the map are not accessible. @@ -532,12 +532,12 @@ function minetest.register_on_punchnode(callback) end --- --- @overload fun(callback:fun(min_pos:Position, max_pos:Position, blockseed:number)) --- @param callback fun(vmanip:VoxelManip, min_pos:Position, max_pos:Position, blockseed:number) -function minetest.register_on_generated(callback) end +function core.register_on_generated(callback) end --- * Called when a new player enters the world for the first time --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4589-L4590) --- @param callback fun(player:Player) -function minetest.register_on_newplayer(callback) end +function core.register_on_newplayer(callback) end --- * Called when a player is punched --- * Note: This callback is invoked even if the punched player is dead. --- * `player`: ObjectRef - Player that was punched @@ -552,14 +552,14 @@ function minetest.register_on_newplayer(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4591-L4602) --- @param callback fun(player:Player, hitter:Player, time_from_last_punch:number|nil, tool_capabilities, dir, damage) -function minetest.register_on_punchplayer(callback) end +function core.register_on_punchplayer(callback) end --- * Called when a player is right-clicked --- * `player`: ObjectRef - Player that was right-clicked --- * `clicker`: ObjectRef - Object that right-clicked, may or may not be a player --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4603-L4606) --- @param callback fun(player:Player, clicker:Player) -function minetest.register_on_rightclickplayer(callback) end +function core.register_on_rightclickplayer(callback) end --- @alias PlayerHPChangeReasonType --- | "set_hp" # A mod or the engine called `set_hp` without giving a type - use this for custom damage types. @@ -600,39 +600,39 @@ function minetest.register_on_rightclickplayer(callback) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4607-L4626) --- @param callback fun(player:Player, hp_change:number, reason:PlayerHPChangeReason)|fun(player:Player, hp_change:number, reason:PlayerHPChangeReason):number,boolean --- @param modifier boolean -function minetest.register_on_player_hpchange(callback, modifier) end +function core.register_on_player_hpchange(callback, modifier) end --- * Called when a player dies --- * `reason`: a PlayerHPChangeReason table, see register_on_player_hpchange --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4627-L4629) --- @param callback fun(player:ObjectRef, reason:PlayerHPChangeReason) -function minetest.register_on_dieplayer(callback) end +function core.register_on_dieplayer(callback) end --- * Called when player is to be respawned --- * Called _before_ repositioning of player occurs --- * return true in func to disable regular player placement --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4630-L4633) --- @param callback fun(player:ObjectRef):boolean|nil -function minetest.register_on_respawnplayer(callback) end +function core.register_on_respawnplayer(callback) end --- * Called when a client connects to the server, prior to authentication --- * If it returns a string, the client is disconnected with that string as --- reason. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4634-L4637) --- @param callback fun(name:string, ip:string):nil|string -function minetest.register_on_prejoinplayer(callback) end +function core.register_on_prejoinplayer(callback) end --- * Called when a player joins the game --- * `last_login`: The timestamp of the previous login, or nil if player is new --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4638-L4640) --- @param callback fun(player:Player, last_login:number) -function minetest.register_on_joinplayer(callback) end +function core.register_on_joinplayer(callback) end --- * Called when a player leaves the game --- * `timed_out`: True for timeout, false for other reasons. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4641-L4643) --- @param callback fun(player:Player, timed_out:boolean) -function minetest.register_on_leaveplayer(callback) end +function core.register_on_leaveplayer(callback) end --- * Called when a client attempts to log into an account. --- * `name`: The name of the account being authenticated. --- * `ip`: The IP address of the client @@ -641,13 +641,13 @@ function minetest.register_on_leaveplayer(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4644-L4649) --- @param callback fun(name, ip, is_success) -function minetest.register_on_authplayer(callback) end ---- * Deprecated: use `minetest.register_on_authplayer(name, ip, is_success)` instead. +function core.register_on_authplayer(callback) end +--- * Deprecated: use `core.register_on_authplayer(name, ip, is_success)` instead. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4650-L4651) --- @deprecated --- @param callback fun(name, ip) -function minetest.register_on_auth_fail(callback) end +function core.register_on_auth_fail(callback) end --- * Called when a player cheats --- * `cheat`: `{type=}`, where `` is one of: --- * `moved_too_fast` @@ -660,22 +660,22 @@ function minetest.register_on_auth_fail(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4652-L4661) --- @param callback fun(ObjectRef, cheat) -function minetest.register_on_cheat(callback) end +function core.register_on_cheat(callback) end --- * Called always when a player says something --- * Return `true` to mark the message as handled, which means that it will --- not be sent to other players. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4662-L4665) --- @param callback fun(name, message) -function minetest.register_on_chat_message(callback) end ---- * Called always when a chatcommand is triggered, before `minetest.registered_chatcommands` +function core.register_on_chat_message(callback) end +--- * Called always when a chatcommand is triggered, before `core.registered_chatcommands` --- is checked to see if the command exists, but after the input is parsed. --- * Return `true` to mark the command as handled, which means that the default --- handlers will be prevented. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4666-L4670) --- @param callback fun(name, command, params) -function minetest.register_on_chatcommand(callback) end +function core.register_on_chatcommand(callback) end --- * Called when the server received input from `player` in a formspec with --- the given `formname`. Specifically, this is called on any of the --- following events: @@ -700,9 +700,9 @@ function minetest.register_on_chatcommand(callback) end --- dropdown argument. --- * `tabheader`: Tab index, starting with `"1"` (only if tab changed) --- * `checkbox`: `"true"` if checked, `"false"` if unchecked ---- * `textlist`: See `minetest.explode_textlist_event` ---- * `table`: See `minetest.explode_table_event` ---- * `scrollbar`: See `minetest.explode_scrollbar_event` +--- * `textlist`: See `core.explode_textlist_event` +--- * `table`: See `core.explode_table_event` +--- * `scrollbar`: See `core.explode_scrollbar_event` --- * Special case: `["quit"]="true"` is sent when the user actively --- closed the form by mouse click, keypress or through a button_exit[] --- element. @@ -716,7 +716,7 @@ function minetest.register_on_chatcommand(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4671-L4708) --- @param callback fun(player, formname, fields) -function minetest.register_on_player_receive_fields(callback) end +function core.register_on_player_receive_fields(callback) end --- * Called when `player` crafts something --- * `itemstack` is the output --- * `old_craft_grid` contains the recipe (Note: the one in the inventory is @@ -727,13 +727,13 @@ function minetest.register_on_player_receive_fields(callback) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4709-L4716) --- @param callback fun(itemstack, player, old_craft_grid, craft_inv) -function minetest.register_on_craft(callback) end +function core.register_on_craft(callback) end --- * The same as before, except that it is called before the player crafts, to --- make craft prediction, and it should not change anything. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4717-L4719) --- @param callback fun(itemstack, player, old_craft_grid, craft_inv) -function minetest.register_craft_predict() end +function core.register_craft_predict() end --- * Determines how much of a stack may be taken, put or moved to a --- player inventory. --- * `player` (type `ObjectRef`) is the player who modified the inventory @@ -748,68 +748,68 @@ function minetest.register_craft_predict() end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4720-L4731) --- @param callback fun(player, action, inventory, inventory_info) -function minetest.register_allow_player_inventory_action() end +function core.register_allow_player_inventory_action() end --- * Called after a take, put or move event from/to/in a player inventory ---- * Function arguments: see `minetest.register_allow_player_inventory_action` +--- * Function arguments: see `core.register_allow_player_inventory_action` --- * Does not accept or handle any return value. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4732-L4735) --- @param callback fun(player, action, inventory, inventory_info) -function minetest.register_on_player_inventory_action() end +function core.register_on_player_inventory_action() end --- * Called by `builtin` and mods when a player violates protection at a --- position (eg, digs a node or punches a protected entity). --- * The registered functions can be called using ---- `minetest.record_protection_violation`. +--- `core.record_protection_violation`. --- * The provided function should check that the position is protected by the --- mod calling this function before it prints a message, if it does, to --- allow for multiple protection mods. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4736-L4743) --- @param callback fun(pos, name) -function minetest.register_on_protection_violation() end ---- * Called when an item is eaten, by `minetest.item_eat` +function core.register_on_protection_violation() end +--- * Called when an item is eaten, by `core.item_eat` --- * Return `itemstack` to cancel the default item eat response (i.e.: hp increase). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4744-L4746) --- @param callback fun(hp_change, replace_with_item, itemstack, user, pointed_thing) -function minetest.register_on_item_eat() end +function core.register_on_item_eat() end --- * Called when `granter` grants the priv `priv` to `name`. --- * Note that the callback will be called twice if it's done by a player, --- once with granter being the player name, and again with granter being nil. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4747-L4750) --- @param callback fun(name, granter, priv) -function minetest.register_on_priv_grant() end +function core.register_on_priv_grant() end --- * Called when `revoker` revokes the priv `priv` from `name`. --- * Note that the callback will be called twice if it's done by a player, --- once with revoker being the player name, and again with revoker being nil. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4751-L4754) --- @param callback fun(name, revoker, priv) -function minetest.register_on_priv_revoke() end +function core.register_on_priv_revoke() end --- * Called when `name` user connects with `ip`. --- * Return `true` to by pass the player limit --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4755-L4757) --- @param callback fun(name, ip) -function minetest.register_can_bypass_userlimit() end +function core.register_can_bypass_userlimit() end --- * Called when an incoming mod channel message is received --- * You should have joined some channels to receive events. --- * If message comes from a server mod, `sender` field is an empty string. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4758-L4761) --- @param callback fun(channel_name, sender, message) -function minetest.register_on_modchannel_message() end +function core.register_on_modchannel_message() end -- Setting-related: --- @type Settings -minetest.settings = {} +core.settings = {} --- Loads a setting from the main settings and --- parses it as a position (in the format `(1,2,3)`). Returns a position or nil. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4768-L4769) -function minetest.setting_get_pos(name) end +function core.setting_get_pos(name) end -- Authentication: --- * Converts string representation of privs into table form @@ -820,7 +820,7 @@ function minetest.setting_get_pos(name) end --- @param str string --- @param delim string --- @return table -function minetest.string_to_privs(str, delim) end +function core.string_to_privs(str, delim) end --- * Returns the string representation of `privs` --- * `delim`: [Optional] String to delimit privs. Defaults to `","`. --- @@ -828,12 +828,12 @@ function minetest.string_to_privs(str, delim) end --- @param privs table --- @param delim string --- @return string -function minetest.privs_to_string(privs, delim) end +function core.privs_to_string(privs, delim) end --- Returns -> {priv1=true,...} --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4781-L4781) --- @param name string --- @return table -function minetest.get_player_privs(name) end +function core.get_player_privs(name) end --- Returns `bool, missing_privs` --- * A quickhand for checking privileges. --- * `player_or_name`: Either a Player object or the name of a player. @@ -843,7 +843,7 @@ function minetest.get_player_privs(name) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4782-L4787) --- @param player_or_name Player|string --- @return boolean,table -function minetest.check_player_privs(player_or_name, ...) end +function core.check_player_privs(player_or_name, ...) end --- * Returns true if the "password entry" for a player with name matches given --- password, false otherwise. --- * The "password entry" is the password representation generated by the @@ -852,58 +852,58 @@ function minetest.check_player_privs(player_or_name, ...) end --- external protocols such as IRC, other uses are frowned upon. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4789-L4795) -function minetest.check_password_entry(name, entry, password) end +function core.check_password_entry(name, entry, password) end --- * Convert a name-password pair to a password hash that Minetest can use. --- * The returned value alone is not a good basis for password checks based --- on comparing the password hash in the database with the password hash --- from the function, with an externally provided password, as the hash --- in the db might use the new SRP verifier format. ---- * For this purpose, use `minetest.check_password_entry` instead. +--- * For this purpose, use `core.check_password_entry` instead. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4796-L4802) -function minetest.get_password_hash(name, raw_password) end +function core.get_password_hash(name, raw_password) end --- Returns an IP address string for the player --- `name`. --- * The player needs to be online for this to be successful. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4803-L4805) -function minetest.get_player_ip(name) end +function core.get_player_ip(name) end --- Return the currently active auth handler --- * See the [Authentication handler definition] --- * Use this to e.g. get the authentication data for a player: ---- `local auth_data = minetest.get_auth_handler().get_auth(playername)` +--- `local auth_data = core.get_auth_handler().get_auth(playername)` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4807-L4810) ---@return AuthenticationHandlerDefinition -function minetest.get_auth_handler() end +function core.get_auth_handler() end --- * Must be called by the authentication handler for privilege changes. --- * `name`: string; if omitted, all auth data should be considered modified --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4811-L4813) -function minetest.notify_authentication_modified(name) end +function core.notify_authentication_modified(name) end --- Set password hash of --- player `name`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4814-L4815) -function minetest.set_player_password(name, password_hash) end +function core.set_player_password(name, password_hash) end --- Set privileges of player --- `name`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4816-L4817) --- @param name string --- @param privs table object like `{priv1=true,...}` -function minetest.set_player_privs(name, privs) end +function core.set_player_privs(name, privs) end --- * See `reload()` in authentication handler definition --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4818-L4819) -function minetest.auth_reload() end +function core.auth_reload() end -- Chat: --- @param text string -function minetest.chat_send_all(text) end +function core.chat_send_all(text) end --- @param name string player name to send to --- @param text string -function minetest.chat_send_player(name, text) end +function core.chat_send_player(name, text) end --- * Used by the server to format a chat message, based on the setting `chat_message_format`. --- Refer to the documentation of the setting for a list of valid placeholders. --- * Takes player name and message, and returns the formatted string to be sent to players. @@ -911,25 +911,25 @@ function minetest.chat_send_player(name, text) end --- * **Only** the first occurrence of each placeholder will be replaced. --- @param name string player name to send to --- @param message string -function minetest.format_chat_message(name, message) end +function core.format_chat_message(name, message) end -- Environment access: --- @param pos Position --- @param node NodeTable --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4840-L4840) -function minetest.set_node(pos, node) end ---- Alias to `minetest.set_node` +function core.set_node(pos, node) end +--- Alias to `core.set_node` --- * Set node at position `pos` --- * `node`: table `{name=string, param1=number, param2=number}` --- * If param1 or param2 is omitted, it's set to `0`. ---- * e.g. `minetest.set_node({x=0, y=10, z=0}, {name="default:wood"})` +--- * e.g. `core.set_node({x=0, y=10, z=0}, {name="default:wood"})` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4841-L4845) -function minetest.add_node(pos, node) end +function core.add_node(pos, node) end --- * Set node on all positions set in the first argument. ---- * e.g. `minetest.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name="default:stone"})` ---- * For node specification or position syntax see `minetest.set_node` call +--- * e.g. `core.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name="default:stone"})` +--- * For node specification or position syntax see `core.set_node` call --- * Faster than set_node due to single call, but still considerably slower --- than Lua Voxel Manipulators (LVM) for large numbers of nodes. --- Unlike LVMs, this will call node callbacks. It also allows setting nodes @@ -941,7 +941,7 @@ function minetest.add_node(pos, node) end --- --- @param positions Position[] {pos1, pos2, pos3, ...} --- @param node NodeTable -function minetest.bulk_set_node(positions, node) end +function core.bulk_set_node(positions, node) end --- Swap node at position with another. --- * This keeps the metadata intact and will not run con-/destructor callbacks. @@ -950,14 +950,14 @@ function minetest.bulk_set_node(positions, node) end --- --- @param pos Position --- @param node NodeTable -function minetest.swap_node(pos, node) end +function core.swap_node(pos, node) end --- Equivalent to core.set_node(pos, {name="air"}), but a bit faster. --- (Any existing metadata is deleted.) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4858-L4859) --- @param pos Position -function minetest.remove_node(pos) end +function core.remove_node(pos) end --- * Returns the node at the given position as table in the format --- `{name="node_name", param1=0, param2=0}`, --- returns `{name="ignore", param1=0, param2=0}` for unloaded areas. @@ -965,13 +965,13 @@ function minetest.remove_node(pos) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4860-L4863) ---@param pos Position ---@return NodeTable -function minetest.get_node(pos) end +function core.get_node(pos) end --- * Same as `get_node` but returns `nil` for unloaded areas. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4864-L4865) --- @param pos Position --- @return NodeTable|nil -function minetest.get_node_or_nil(pos) end +function core.get_node_or_nil(pos) end --- * Gets the light value at the given position. Note that the light value --- "inside" the node at the given position is returned, so you usually want --- to get the light value of a neighbor. @@ -982,7 +982,7 @@ function minetest.get_node_or_nil(pos) end --- @param pos Position The position where to measure the light. --- @param timeofday number|nil `nil` for current time, `0` for night, `0.5` for day --- @return number|nil -function minetest.get_node_light(pos, timeofday) end +function core.get_node_light(pos, timeofday) end --- * Figures out the sunlight (or moonlight) value at pos at the given time of --- day. --- * `pos`: The position of the node @@ -992,7 +992,7 @@ function minetest.get_node_light(pos, timeofday) end --- unlikely --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4874-L4881) -function minetest.get_natural_light(pos, timeofday) end +function core.get_natural_light(pos, timeofday) end --- * Calculates the artificial light (light from e.g. torches) value from the --- `param1` value. --- * `param1`: The param1 value of a `paramtype = "light"` node. @@ -1001,41 +1001,41 @@ function minetest.get_natural_light(pos, timeofday) end --- ensures compatibility. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4882-L4888) -function minetest.get_artificial_light(param1) end +function core.get_artificial_light(param1) end --- * Place node with the same effects that a player would cause --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4889-L4890) -function minetest.place_node(pos, node) end +function core.place_node(pos, node) end --- * Dig node with the same effects that a player would cause --- * Returns `true` if successful, `false` on failure (e.g. protected location) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4891-L4893) -function minetest.dig_node(pos) end +function core.dig_node(pos) end --- * Punch node with the same effects that a player would cause --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4894-L4895) -function minetest.punch_node(pos) end +function core.punch_node(pos) end --- * Change node into falling node --- * Returns `true` if successful, `false` on failure --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4896-L4898) -function minetest.spawn_falling_node(pos) end +function core.spawn_falling_node(pos) end --- * Get a table of positions of nodes that have metadata within a region --- {pos1, pos2}. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4900-L4902) -function minetest.find_nodes_with_meta(pos1, pos2) end +function core.find_nodes_with_meta(pos1, pos2) end --- * Get a `NodeMetaRef` at that position --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4903-L4904) --- @param pos Position --- @return NodeMetaRef -function minetest.get_meta(pos) end +function core.get_meta(pos) end --- * Get `NodeTimerRef` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4905-L4906) --- @return NodeTimerRef -function minetest.get_node_timer(pos) end +function core.get_node_timer(pos) end --- Spawn Lua-defined entity at --- position. --- * Returns `ObjectRef`, or `nil` if failed @@ -1043,19 +1043,19 @@ function minetest.get_node_timer(pos) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4908-L4910) --- `staticdata` [Optional] no info --- @return ObjectRef|Entity|nil -function minetest.add_entity(pos, name, staticdata) end +function core.add_entity(pos, name, staticdata) end --- Spawn item --- * Returns `ObjectRef`, or `nil` if failed --- @return ObjectRef|nil --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4911-L4912) -function minetest.add_item(pos, item) end +function core.add_item(pos, item) end --- Get an `ObjectRef` to a player --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4913-L4913) --- @param name string --- @return Player|nil -function minetest.get_player_by_name(name) end +function core.get_player_by_name(name) end --- Returns a list of --- ObjectRefs. --- * `radius`: using an euclidean metric @@ -1064,7 +1064,7 @@ function minetest.get_player_by_name(name) end --- @param pos Position --- @param radius number --- @return ObjectRef[]|Entity[]|Player[] -function minetest.get_objects_inside_radius(pos, radius) end +function core.get_objects_inside_radius(pos, radius) end --- Returns a list of --- ObjectRefs. --- * `pos1` and `pos2` are the min and max positions of the area to search. @@ -1073,26 +1073,26 @@ function minetest.get_objects_inside_radius(pos, radius) end --- @param pos1 Position --- @param pos2 Position --- @return ObjectRef[]|Entity[]|Player[] -function minetest.get_objects_in_area(pos1, pos2) end +function core.get_objects_in_area(pos1, pos2) end --- * `val` is between `0` and `1`; `0` for midnight, `0.5` for midday --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4920-L4921) ---@param val number -function minetest.set_timeofday(val) end +function core.set_timeofday(val) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4922-L4922) ---@return number -function minetest.get_timeofday() end +function core.get_timeofday() end --- Returns the time, in seconds, since the world was --- created. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4923-L4924) -function minetest.get_gametime() end +function core.get_gametime() end --- Returns number days elapsed since world was --- created. --- * accounts for time changes. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4925-L4927) -function minetest.get_day_count() end +function core.get_day_count() end --- Returns pos or `nil`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4928-L4933) @@ -1103,7 +1103,7 @@ function minetest.get_day_count() end --- @param search_in_center boolean Optional. If true `pos` is also checked for the nodes. (default: `false`). --- --- @return Position|nil -function minetest.find_node_near(pos, radius, node_names, search_in_center) end +function core.find_node_near(pos, radius, node_names, search_in_center) end --- * If `grouped` is true the return value is a table indexed by node name --- which contains lists of positions. --- * If `grouped` is false or absent the return values are as follows: @@ -1119,7 +1119,7 @@ function minetest.find_node_near(pos, radius, node_names, search_in_center) end --- @param grouped boolean? [optional] If true the return value is a table indexed by node name which contains lists of positions. (default: `false`). --- --- @return (table|Position[]), (nil|table) -function minetest.find_nodes_in_area(pos1, pos2, node_names, grouped) end +function core.find_nodes_in_area(pos1, pos2, node_names, grouped) end --- Returns a --- list of positions. --- * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"` @@ -1127,26 +1127,27 @@ function minetest.find_nodes_in_area(pos1, pos2, node_names, grouped) end --- * Area volume is limited to 4,096,000 nodes --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4944-L4948) -function minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames) end +function core.find_nodes_in_area_under_air(pos1, pos2, nodenames) end --- * Deprecated: renamed to `core.get_value_noise` in version 5.12.0. --- @deprecated --- @param noiseparams NoiseParams --- @return ValueNoise -function minetest.get_perlin(noiseparams) end +function core.get_perlin(noiseparams) end --- * Deprecated: renamed to core.get_value_noise in version 5.12.0. --- @deprecated --- @return ValueNoise -function minetest.get_perlin(seeddiff, octaves, persistence, spread) end +function core.get_perlin(seeddiff, octaves, persistence, spread) end --- * Return world-specific value noise. --- * The actual seed used is the noiseparams seed plus the world seed. --- * **Important**: Requires the mapgen environment to be initalized, do not use at load time. --- @param noiseparams NoiseParams --- @return ValueNoise -function minetest.get_value_noise(noiseparams) end +function core.get_value_noise(noiseparams) end --- * Deprecated: use `core.get_value_noise(noiseparams)` instead. --- @deprecated --- @return ValueNoise -function minetest.get_value_noise(seeddiff, octaves, persistence, spread) end +function core.get_value_noise(seeddiff, octaves, persistence, spread) end + --- * Return voxel manipulator object. --- * Loads the manipulator from the map if positions are passed. --- @@ -1154,7 +1155,7 @@ function minetest.get_value_noise(seeddiff, octaves, persistence, spread) end --- @param min_position Position? min position --- @param max_position Position? max position --- @return VoxelManip -function minetest.get_voxel_manip(min_position, max_position) end +function core.get_voxel_manip(min_position, max_position) end --- * Set the types of on-generate notifications that should be collected. --- * `flags` is a flag field with the available flags: --- * dungeon @@ -1170,23 +1171,23 @@ function minetest.get_voxel_manip(min_position, max_position) end --- @param custom_ids table? list of user-defined IDs (strings) which are requested. --- By convention these should be the mod name with an optional --- colon and specifier added, e.g. `"default"` or `"default:dungeon_loot"` -function minetest.set_gen_notify(flags, deco_ids, custom_ids) end +function core.set_gen_notify(flags, deco_ids, custom_ids) end --- * Returns a flagstring and a table with the `deco_id`s. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4970-L4971) -function minetest.get_gen_notify() end +function core.get_gen_notify() end --- * Returns the decoration ID number for the provided decoration name string, --- or `nil` on failure. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4972-L4974) -function minetest.get_decoration_id(decoration_name) end +function core.get_decoration_id(decoration_name) end --- * `voxelmanip` - VoxelManip object --- * `heightmap` - 2D array of height values (y) --- * `biomemap` - 2D array of biome IDs --- * `heatmap` - 2D array of heat values (0-255) --- * `humiditymap` - 2D array of humidity values (0-255) ---- * `gennotify` - Table of on-generate notifications (see `minetest.set_gen_notify`) +--- * `gennotify` - Table of on-generate notifications (see `core.set_gen_notify`) --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4970-L4971) --- @alias MapgenObjectName --- | "voxelmanip" # VoxelManip object @@ -1194,7 +1195,7 @@ function minetest.get_decoration_id(decoration_name) end --- | "biomemap" # 2D? array of biome IDs --- | "heatmap" # 2D? array of heat values (0-255) --- | "humiditymap" # 2D? array of humidity values (0-255) ---- | "gennotify" # Table of on-generate notifications (see `minetest.set_gen_notify`) +--- | "gennotify" # Table of on-generate notifications (see `core.set_gen_notify`) --- Returns requested mapgen object if available (see [Mapgen objects]) --- @@ -1207,15 +1208,15 @@ function minetest.get_decoration_id(decoration_name) end --- @overload fun(objectname:"gennotify") :table --- @param objectname MapgenObjectName one of: "voxelmanip", "heightmap", "biomemap", "heatmap", "humiditymap", "gennotify" --- @return VoxelManip|number[][]|number[][][], Position, Position -function minetest.get_mapgen_object(objectname) end +function core.get_mapgen_object(objectname) end --- * Returns the heat at the position, or `nil` on failure. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4977-L4978) -function minetest.get_heat(pos) end +function core.get_heat(pos) end --- * Returns the humidity at the position, or `nil` on failure. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4979-L4980) -function minetest.get_humidity(pos) end +function core.get_humidity(pos) end --- * Returns a table containing: --- * `biome` the biome id of the biome at that position --- * `heat` the heat at the position @@ -1223,19 +1224,19 @@ function minetest.get_humidity(pos) end --- * Or returns `nil` on failure. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4981-L4986) -function minetest.get_biome_data(pos) end +function core.get_biome_data(pos) end --- * Returns the biome id, as used in the biomemap Mapgen object and returned ---- by `minetest.get_biome_data(pos)`, for a given biome_name string. +--- by `core.get_biome_data(pos)`, for a given biome_name string. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4987-L4989) -function minetest.get_biome_id(biome_name) end +function core.get_biome_id(biome_name) end --- * Returns the biome name string for the provided biome id, or `nil` on --- failure. --- * If no biomes have been registered, such as in mgv6, returns `default`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4990-L4993) -function minetest.get_biome_name(biome_id) end ---- * Deprecated: use `minetest.get_mapgen_setting(name)` instead. +function core.get_biome_name(biome_id) end +--- * Deprecated: use `core.get_mapgen_setting(name)` instead. --- * Returns a table containing: --- * `mgname` --- * `seed` @@ -1244,8 +1245,8 @@ function minetest.get_biome_name(biome_id) end --- * `flags` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4994-L5001) -function minetest.get_mapgen_params() end ---- * Deprecated: use `minetest.set_mapgen_setting(name, value, override)` +function core.get_mapgen_params() end +--- * Deprecated: use `core.set_mapgen_setting(name, value, override)` --- instead. --- * Set map generation parameters. --- * Function cannot be called after the registration period; only @@ -1263,7 +1264,7 @@ function minetest.get_mapgen_params() end --- `minetest.conf`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5002-L5018) -function minetest.set_mapgen_params(MapgenParams) end +function core.set_mapgen_params(MapgenParams) end --- * Gets the *active* mapgen setting (or nil if none exists) in string --- format with the following order of precedence: --- 1) Settings loaded from map_meta.txt or overrides set during mod @@ -1274,12 +1275,12 @@ function minetest.set_mapgen_params(MapgenParams) end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5019-L5026) --- @return string|nil -function minetest.get_mapgen_setting(name) end +function core.get_mapgen_setting(name) end --- * Same as above, but returns the value as a NoiseParams table if the --- setting `name` exists and is a valid NoiseParams. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5027-L5029) -function minetest.get_mapgen_setting_noiseparams(name) end +function core.get_mapgen_setting_noiseparams(name) end --- * Sets a mapgen param to `value`, and will take effect if the corresponding --- mapgen setting is not already present in map_meta.txt. --- * `override_meta` [Optional] is an optional boolean (default: `false`). If this is set @@ -1288,11 +1289,11 @@ function minetest.get_mapgen_setting_noiseparams(name) end --- * Note: to set the seed, use `"seed"`, not `"fixed_map_seed"`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5030-L5036) -function minetest.set_mapgen_setting(name, value, override_meta) end +function core.set_mapgen_setting(name, value, override_meta) end --- * Same as above, except value is a NoiseParams table. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5037-L5038) -function minetest.set_mapgen_setting_noiseparams(name, value, override_meta) end +function core.set_mapgen_setting_noiseparams(name, value, override_meta) end --- * Sets the noiseparams setting of `name` to the noiseparams table specified --- in `noiseparams`. --- * `set_default` is an optional boolean (default: `true`) that specifies @@ -1300,23 +1301,23 @@ function minetest.set_mapgen_setting_noiseparams(name, value, override_meta) end --- active config. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5039-L5044) -function minetest.set_noiseparams(name, noiseparams, set_default) end +function core.set_noiseparams(name, noiseparams, set_default) end --- * Returns a table of the noiseparams for name. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5045-L5046) -function minetest.get_noiseparams(name) end +function core.get_noiseparams(name) end --- * Generate all registered ores within the VoxelManip `vm` and in the area --- from `pos1` to `pos2`. --- * `pos1` and `pos2` are optional and default to mapchunk minp and maxp. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5047-L5050) -function minetest.generate_ores(vm, pos1, pos2) end +function core.generate_ores(vm, pos1, pos2) end --- * Generate all registered decorations within the VoxelManip `vm` and in the --- area from `pos1` to `pos2`. --- * `pos1` and `pos2` are optional and default to mapchunk minp and maxp. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5051-L5054) -function minetest.generate_decorations(vm, pos1, pos2) end +function core.generate_decorations(vm, pos1, pos2) end --- * Clear all objects in the environment --- * Takes an optional table as an argument with the field `mode`. --- * mode = `"full"` : Load and go through every mapblock, clearing @@ -1326,13 +1327,13 @@ function minetest.generate_decorations(vm, pos1, pos2) end --- mapblocks are next activated. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5055-L5062) -function minetest.clear_objects(options) end +function core.clear_objects(options) end --- * Load the mapblocks containing the area from `pos1` to `pos2`. --- `pos2` defaults to `pos1` if not specified. --- * This function does not trigger map generation. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5063-L5066) -function minetest.load_area(pos1, pos2) end +function core.load_area(pos1, pos2) end --- * Queue all blocks in the area from `pos1` to `pos2`, inclusive, to be --- asynchronously fetched from memory, loaded from disk, or if inexistent, --- generates them. @@ -1343,22 +1344,22 @@ function minetest.load_area(pos1, pos2) end --- * `blockpos` is the *block* coordinates of the block that had been --- emerged. --- * `action` could be one of the following constant values: ---- * `minetest.EMERGE_CANCELLED` ---- * `minetest.EMERGE_ERRORED` ---- * `minetest.EMERGE_FROM_MEMORY` ---- * `minetest.EMERGE_FROM_DISK` ---- * `minetest.EMERGE_GENERATED` +--- * `core.EMERGE_CANCELLED` +--- * `core.EMERGE_ERRORED` +--- * `core.EMERGE_FROM_MEMORY` +--- * `core.EMERGE_FROM_DISK` +--- * `core.EMERGE_GENERATED` --- * `calls_remaining` is the number of callbacks to be expected after --- this one. --- * `param` is the user-defined parameter passed to emerge_area (or --- nil if the parameter was absent). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5067-L5086) -function minetest.emerge_area(pos1, pos2, callback, param) end +function core.emerge_area(pos1, pos2, callback, param) end --- * delete all mapblocks in the area from pos1 to pos2, inclusive --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5087-L5088) -function minetest.delete_area(pos1, pos2) end +function core.delete_area(pos1, pos2) end --- Returns `boolean, pos` --- * Checks if there is anything other than air between pos1 and pos2. --- * Returns false if something is blocking the sight. @@ -1367,7 +1368,7 @@ function minetest.delete_area(pos1, pos2) end --- * `pos2`: Second position --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5089-L5094) -function minetest.line_of_sight(pos1, pos2) end +function core.line_of_sight(pos1, pos2) end --- Returns `Raycast` --- * Creates a `Raycast` object. --- * `pos1`: start of the ray @@ -1376,7 +1377,7 @@ function minetest.line_of_sight(pos1, pos2) end --- * `liquids`: if false, liquid nodes won't be returned. Default is `false`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5095-L5100) -function minetest.raycast(pos1, pos2, objects, liquids) end +function core.raycast(pos1, pos2, objects, liquids) end --- * returns table containing path that can be walked on --- * returns a table of 3D points representing a path from `pos1` to `pos2` or --- `nil` on failure. @@ -1398,34 +1399,34 @@ function minetest.raycast(pos1, pos2, objects, liquids) end --- on-the-fly --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5101-L5120) -function minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm) end +function core.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm) end --- * spawns L-system tree at given `pos` with definition in `treedef` table --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5121-L5122) -function minetest.spawn_tree (pos, treedef) end +function core.spawn_tree (pos, treedef) end --- * add node to liquid update queue --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5123-L5124) -function minetest.transforming_liquid_add(pos) end +function core.transforming_liquid_add(pos) end --- * get max available level for leveled node --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5125-L5126) -function minetest.get_node_max_level(pos) end +function core.get_node_max_level(pos) end --- * get level of leveled node (water, snow) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5127-L5128) -function minetest.get_node_level(pos) end +function core.get_node_level(pos) end --- * set level of leveled node, default `level` equals `1` --- * if `totallevel > maxlevel`, returns rest (`total-max`). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5129-L5131) -function minetest.set_node_level(pos, level) end +function core.set_node_level(pos, level) end --- * increase level of leveled node by level, default `level` equals `1` --- * if `totallevel > maxlevel`, returns rest (`total-max`) --- * `level` must be between -127 and 127 --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5132-L5135) -function minetest.add_node_level(pos, level) end +function core.add_node_level(pos, level) end --- Returns `true`/`false` --- * resets the light in a cuboid-shaped part of --- the map and removes lighting bugs. @@ -1444,20 +1445,20 @@ function minetest.add_node_level(pos, level) end --- `true` otherwise --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5136-L5151) -function minetest.fix_light(pos1, pos2) end +function core.fix_light(pos1, pos2) end --- * causes an unsupported `group:falling_node` node to fall and causes an --- unattached `group:attached_node` node to fall. --- * does not spread these updates to neighbours. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5152-L5155) -function minetest.check_single_for_falling(pos) end +function core.check_single_for_falling(pos) end --- * causes an unsupported `group:falling_node` node to fall and causes an --- unattached `group:attached_node` node to fall. --- * spread these updates to neighbours and can cause a cascade --- of nodes to fall. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5156-L5160) -function minetest.check_for_falling(pos) end +function core.check_for_falling(pos) end --- * Returns a player spawn y co-ordinate for the provided (x, z) --- co-ordinates, or `nil` for an unsuitable spawn point. --- * For most mapgens a 'suitable spawn point' is one with y between @@ -1468,15 +1469,15 @@ function minetest.check_for_falling(pos) end --- full-node biome 'dust' nodes. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5161-L5169) -function minetest.get_spawn_level(x, z) end +function core.get_spawn_level(x, z) end -- Mod channels: --- * Server joins channel `channel_name`, and creates it if necessary. You --- should listen for incoming messages with ---- `minetest.register_on_modchannel_message` +--- `core.register_on_modchannel_message` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5176-L5179) -function minetest.mod_channel_join(channel_name) end +function core.mod_channel_join(channel_name) end -- Inventory: --- returns an InvRef @@ -1485,7 +1486,7 @@ function minetest.mod_channel_join(channel_name) end --- {type="node", pos={x=, y=, z=}} --- {type="detached", name="creative"} --- @return InvRef -function minetest.get_inventory(location) end +function core.get_inventory(location) end --- Returns --- an `InvRef`. --- * `callbacks`: See [Detached inventory callbacks] @@ -1501,40 +1502,40 @@ function minetest.get_inventory(location) end --- @param callbacks DetachedInventoryCallbacksDef --- @param player_name string --- @return InvRef -function minetest.create_detached_inventory(name, callbacks, player_name) end +function core.create_detached_inventory(name, callbacks, player_name) end --- * Returns a `boolean` indicating whether the removal succeeded. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5199-L5200) -function minetest.remove_detached_inventory(name) end +function core.remove_detached_inventory(name) end --- Returns left over ItemStack. ---- * See `minetest.item_eat` and `minetest.register_on_item_eat` +--- * See `core.item_eat` and `core.register_on_item_eat` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5201-L5203) -function minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing) end +function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing) end -- Formspec: --- @param player_name string name of player to show formspec --- @param form_name string name passed to `on_player_receive_fields` callbacks. It should follow the `"modname:"` naming convention ---- @param form_spec string formspec to display (https://minetest.gitlab.io/minetest/formspec/) +--- @param form_spec string formspec to display (https://api.luanti.org/formspec/) --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5208-L5212) -function minetest.show_formspec(player_name, form_name, form_spec) end +function core.show_formspec(player_name, form_name, form_spec) end --- * `playername`: name of player to close formspec --- * `formname`: has to exactly match the one given in `show_formspec`, or the --- formspec will not close. --- * calling `show_formspec(playername, formname, "")` is equal to this --- expression. --- * to close a formspec regardless of the formname, call ---- `minetest.close_formspec(playername, "")`. +--- `core.close_formspec(playername, "")`. --- **USE THIS ONLY WHEN ABSOLUTELY NECESSARY!** --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5213-L5221) -function minetest.close_formspec(playername, formname) end +function core.close_formspec(playername, formname) end --- Returns a string --- * escapes the characters "[", "]", "\", "," and ";", which can not be used --- in formspecs. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3262-L3264) -function minetest.formspec_escape(string) end +function core.formspec_escape(string) end --- Returns a table --- * returns e.g. `{type="CHG", row=1, column=2}` --- * `type` is one of: @@ -1543,7 +1544,7 @@ function minetest.formspec_escape(string) end --- * `"DCL"`: double-click --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5225-L5230) -function minetest.explode_table_event(string) end +function core.explode_table_event(string) end --- Returns a table --- * returns e.g. `{type="CHG", index=1}` --- * `type` is one of: @@ -1552,7 +1553,7 @@ function minetest.explode_table_event(string) end --- * `"DCL"`: double-click --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5231-L5236) -function minetest.explode_textlist_event(string) end +function core.explode_textlist_event(string) end --- Returns a table --- * returns e.g. `{type="CHG", value=500}` --- * `type` is one of: @@ -1561,69 +1562,69 @@ function minetest.explode_textlist_event(string) end --- * `"VAL"`: not changed --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5237-L5242) -function minetest.explode_scrollbar_event(string) end +function core.explode_scrollbar_event(string) end -- Item handling: --- * Returns a string for making an image of a cube (useful as an item image) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5247-L5248) -function minetest.inventorycube(img1, img2, img3) end +function core.inventorycube(img1, img2, img3) end --- * Returns the position of a `pointed_thing` or `nil` if the `pointed_thing` --- does not refer to a node or entity. --- * If the optional `above` parameter is true and the `pointed_thing` refers --- to a node, then it will return the `above` position of the `pointed_thing`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5249-L5253) -function minetest.get_pointed_thing_position(pointed_thing, above) end +function core.get_pointed_thing_position(pointed_thing, above) end --- * Convert a vector to a facedir value, used in `param2` for --- `paramtype2="facedir"`. --- * passing something non-`nil`/`false` for the optional second parameter --- causes it to take the y component into account. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5254-L5258) -function minetest.dir_to_facedir(dir, is6d) end +function core.dir_to_facedir(dir, is6d) end --- * Convert a facedir back into a vector aimed directly out the "back" of a --- node. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5259-L5261) -function minetest.facedir_to_dir(facedir) end +function core.facedir_to_dir(facedir) end --- * Convert a vector to a wallmounted value, used for --- `paramtype2="wallmounted"`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5262-L5264) -function minetest.dir_to_wallmounted(dir) end +function core.dir_to_wallmounted(dir) end --- * Convert a wallmounted value back into a vector aimed directly out the --- "back" of a node. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5265-L5267) -function minetest.wallmounted_to_dir(wallmounted) end +function core.wallmounted_to_dir(wallmounted) end --- * Convert a vector into a yaw (angle) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5268-L5269) -function minetest.dir_to_yaw(dir) end +function core.dir_to_yaw(dir) end --- * Convert yaw (angle) to a vector --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5270-L5271) -function minetest.yaw_to_dir(yaw) end +function core.yaw_to_dir(yaw) end --- * Returns a boolean. Returns `true` if the given `paramtype2` contains --- color information (`color`, `colorwallmounted` or `colorfacedir`). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5272-L5274) -function minetest.is_colored_paramtype(ptype) end +function core.is_colored_paramtype(ptype) end --- * Removes everything but the color information from the --- given `param2` value. --- * Returns `nil` if the given `paramtype2` does not contain color --- information. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5275-L5279) -function minetest.strip_param2_color(param2, paramtype2) end +function core.strip_param2_color(param2, paramtype2) end --- * Returns list of itemstrings that are dropped by `node` when dug --- with `toolname`. --- * `node`: node as table or node name --- * `toolname`: name of the tool item (can be `nil`) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5280-L5284) -function minetest.get_node_drops(node, toolname) end +function core.get_node_drops(node, toolname) end --- @class RecipeInput --- @field method string `"normal"` or `"cooking"` or `"fuel"` @@ -1650,7 +1651,7 @@ function minetest.get_node_drops(node, toolname) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5285-L5295) --- @param input RecipeInput --- @return RecipeOutput, RecipeInput -function minetest.get_craft_result(input) end +function core.get_craft_result(input) end --- Returns input --- * returns last registered recipe for output item (node) --- * `output` is a node or item type such as `"default:torch"` @@ -1663,7 +1664,7 @@ function minetest.get_craft_result(input) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5296-L5303) --- @param output string node or item tech name such as `"default:torch"` --- @return RecipeInput -function minetest.get_craft_recipe(output) end +function core.get_craft_recipe(output) end --- @class RecipeEntryTable --- @field method string 'normal' or 'cooking' or 'fuel' @@ -1690,7 +1691,7 @@ function minetest.get_craft_recipe(output) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5304-L5319) --- --- @return RecipeEntryTable[]|nil -function minetest.get_all_craft_recipes(query_item) end +function core.get_all_craft_recipes(query_item) end --- * `drops`: list of itemstrings --- * Handles drops from nodes after digging: Default action is to put them --- into digger's inventory. @@ -1698,7 +1699,7 @@ function minetest.get_all_craft_recipes(query_item) end --- ground) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5320-L5325) -function minetest.handle_node_drops(pos, drops, digger) end +function core.handle_node_drops(pos, drops, digger) end --- Returns an item --- string. --- * Creates an item string which contains palette index information @@ -1709,7 +1710,7 @@ function minetest.handle_node_drops(pos, drops, digger) end --- * `palette_index`: this index is added to the item stack --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5326-L5333) -function minetest.itemstring_with_palette(item, palette_index) end +function core.itemstring_with_palette(item, palette_index) end --- Returns an item string --- * Creates an item string which contains static color information --- for hardware colorization. Use this method if you wish to colorize @@ -1720,7 +1721,7 @@ function minetest.itemstring_with_palette(item, palette_index) end --- * `colorstring`: the new color of the item stack --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5334-L5341) -function minetest.itemstring_with_color(item, colorstring) end +function core.itemstring_with_color(item, colorstring) end -- Rollback: --- Returns `{{actor, pos, time, oldnode, newnode}, ...}` @@ -1728,14 +1729,14 @@ function minetest.itemstring_with_color(item, colorstring) end --- * `actor`: `"player:"`, also `"liquid"`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5346-L5349) -function minetest.rollback_get_node_actions(pos, range, seconds, limit) end +function core.rollback_get_node_actions(pos, range, seconds, limit) end --- Returns --- `boolean, log_messages`. --- * Revert latest actions of someone --- * `actor`: `"player:"`, also `"liquid"`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5350-L5353) -function minetest.rollback_revert_actions_by(actor, seconds) end +function core.rollback_revert_actions_by(actor, seconds) end -- Defaults for the `on_place` and `on_drop` item definition functions: --- * Place item as a node @@ -1752,14 +1753,14 @@ function minetest.rollback_revert_actions_by(actor, seconds) end --- @param param2 number --- @param prevent_after_place boolean --- @return ItemStack, vector|nil -function minetest.item_place_node(itemstack, placer, pointed_thing, param2, prevent_after_place) end +function core.item_place_node(itemstack, placer, pointed_thing, param2, prevent_after_place) end --- * Place item as-is --- * returns the leftover itemstack --- * **Note**: This function is deprecated and will never be called. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5365-L5368) -function minetest.item_place_object(itemstack, placer, pointed_thing) end ---- * Wrapper that calls `minetest.item_place_node` if appropriate +function core.item_place_object(itemstack, placer, pointed_thing) end +--- * Wrapper that calls `core.item_place_node` if appropriate --- * Calls `on_rightclick` of `pointed_thing.under` if defined instead --- * **Note**: is not called when wielded item overrides `on_place` --- * `param2` overrides facedir and wallmounted `param2` @@ -1772,7 +1773,7 @@ function minetest.item_place_object(itemstack, placer, pointed_thing) end --- @param pointed_thing pointed_thing --- @param param2 number --- @return ItemStack, vector|nil -function minetest.item_place(itemstack, placer, pointed_thing, param2) end +function core.item_place(itemstack, placer, pointed_thing, param2) end --- * Runs callbacks registered by `core.register_on_item_pickup` and adds the item to the picker's `"main"` inventory list. --- * Parameters and return value are the same as `on_pickup`. @@ -1782,13 +1783,13 @@ function minetest.item_place(itemstack, placer, pointed_thing, param2) end --- @param pointed_thing pointed_thing --- @param time_from_last_punch number --- @param ... any -function minetest.item_pickup(itemstack, picker, pointed_thing, time_from_last_punch, ...) end +function core.item_pickup(itemstack, picker, pointed_thing, time_from_last_punch, ...) end --- * Global secondary use callback. Does nothing. --- * Parameters and return value are the same as on_secondary_use. --- * **Note**: is not called when wielded item overrides on_secondary_use --- @param itemstack ItemStack --- @param user Player|ObjectRef|nil -function minetest.item_secondary_use(itemstack, user) end +function core.item_secondary_use(itemstack, user) end --- * Drop the item --- * returns the leftover itemstack --- @@ -1797,26 +1798,26 @@ function minetest.item_secondary_use(itemstack, user) end --- @param dropper Player|ObjectRef --- @param pos Position --- @return ItemStack -function minetest.item_drop(itemstack, dropper, pos) end +function core.item_drop(itemstack, dropper, pos) end --- * Returns `function(itemstack, user, pointed_thing)` as a ---- function wrapper for `minetest.do_item_eat`. +--- function wrapper for `core.do_item_eat`. --- * `replace_with_item` is the itemstring which is added to the inventory. --- If the player is eating a stack, then replace_with_item goes to a --- different spot. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5379-L5384) -function minetest.item_eat(hp_change, replace_with_item) end +function core.item_eat(hp_change, replace_with_item) end -- Defaults for the `on_punch` and `on_dig` node definition callbacks: ---- * Calls functions registered by `minetest.register_on_punchnode()` +--- * Calls functions registered by `core.register_on_punchnode()` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5389-L5390) -function minetest.node_punch(pos, node, puncher, pointed_thing) end +function core.node_punch(pos, node, puncher, pointed_thing) end --- * Checks if node can be dug, puts item into inventory, removes node ---- * Calls functions registered by `minetest.registered_on_dignodes()` +--- * Calls functions registered by `core.registered_on_dignodes()` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5391-L5393) -function minetest.node_dig(pos, node, digger) end +function core.node_dig(pos, node, digger) end -- Sounds: --- Returns a handle @@ -1828,12 +1829,12 @@ function minetest.node_dig(pos, node, digger) end --- player actions (e.g. door closing). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5398-L5404) -function minetest.sound_play(spec, parameters, ephemeral) end ---- * `handle` is a handle returned by `minetest.sound_play` +function core.sound_play(spec, parameters, ephemeral) end +--- * `handle` is a handle returned by `core.sound_play` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5405-L5406) -function minetest.sound_stop(handle) end ---- * `handle` is a handle returned by `minetest.sound_play` +function core.sound_stop(handle) end +--- * `handle` is a handle returned by `core.sound_play` --- * `step` determines how fast a sound will fade. --- The gain will change by this much per second, --- until it reaches the target gain. @@ -1843,7 +1844,7 @@ function minetest.sound_stop(handle) end --- Fading to zero will delete the sound. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5407-L5415) -function minetest.sound_fade(handle, step, gain) end +function core.sound_fade(handle, step, gain) end --- @class job local job = {} @@ -1856,7 +1857,7 @@ local job = {} ---@param time number @in seconds ---@param func fun() ---@return job @job (job:cancel() to stop) -function minetest.after(time, func, ...) end +function core.after(time, func, ...) end --- * Cancels the job function from being called function job:cancel() end @@ -1869,12 +1870,12 @@ function job:cancel() end --- with all of the return values as arguments. --- * Optional: Variable number of arguments that are passed to `func` --- @since 5.6 -function minetest.handle_async(func, callback, ...) end +function core.handle_async(func, callback, ...) end --- * Register a path to a Lua file to be imported when an async environment --- is initialized. You can use this to preload code which you can then call ---- later using `minetest.handle_async()`. +--- later using `core.handle_async()`. --- @since 5.6 -function minetest.register_async_dofile(path) end +function core.register_async_dofile(path) end -- Server: --- Request for @@ -1885,11 +1886,11 @@ function minetest.register_async_dofile(path) end --- Zero delay triggers an immediate shutdown. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5430-L5435) -function minetest.request_shutdown(message,reconnect,delay) end +function core.request_shutdown(message,reconnect,delay) end --- Cancel current delayed shutdown --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5436-L5436) -function minetest.cancel_shutdown_requests() end +function core.cancel_shutdown_requests() end --- * Returns the server status string when a player joins or when the command --- `/status` is called. Returns `nil` or an empty string when the message is --- disabled. @@ -1898,25 +1899,25 @@ function minetest.cancel_shutdown_requests() end --- * This function may be overwritten by mods to customize the status message. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5437-L5443) -function minetest.get_server_status(name, joined) end +function core.get_server_status(name, joined) end --- Returns the server uptime in seconds --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5444-L5444) -function minetest.get_server_uptime() end +function core.get_server_uptime() end --- Remove player from database (if they are not --- connected). ---- * As auth data is not removed, minetest.player_exists will continue to +--- * As auth data is not removed, `core.player_exists` will continue to --- return true. Call the below method as well if you want to remove auth --- data too. --- * Returns a code (0: successful, 1: no such player, 2: player is connected) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5445-L5450) -function minetest.remove_player(name) end +function core.remove_player(name) end --- Remove player authentication data --- * Returns boolean indicating success (false if player nonexistant) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5451-L5452) -function minetest.remove_player_auth(name) end +function core.remove_player_auth(name) end --- * `filepath`: path to a media file on the filesystem --- * `callback`: function with arguments `name`, where name is a player name --- (previously there was no callback argument; omitting it is deprecated) @@ -1934,45 +1935,45 @@ function minetest.remove_player_auth(name) end --- or HTTP transfers, dynamic media should not be used with big files. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5453-L5468) -function minetest.dynamic_add_media(filepath, callback) end +function core.dynamic_add_media(filepath, callback) end -- Bans: --- Returns a list of all bans formatted as string --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5473-L5473) -function minetest.get_ban_list() end +function core.get_ban_list() end --- Returns list of bans matching --- IP address or name formatted as string --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5474-L5475) -function minetest.get_ban_description(ip_or_name) end +function core.get_ban_description(ip_or_name) end --- Ban the IP of a currently connected player --- * Returns boolean indicating success --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5476-L5477) -function minetest.ban_player(name) end +function core.ban_player(name) end --- Remove ban record matching --- IP address or name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5478-L5479) -function minetest.unban_player_or_ip(ip_or_name) end +function core.unban_player_or_ip(ip_or_name) end --- Disconnect a player with an optional --- reason. --- * Returns boolean indicating success (false if player nonexistant) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5480-L5482) -function minetest.kick_player(name, reason) end +function core.kick_player(name, reason) end -- Particles: ---- * Deprecated: `minetest.add_particle(pos, velocity, acceleration, +--- * Deprecated: `core.add_particle(pos, velocity, acceleration, --- expirationtime, size, collisiondetection, texture, playername)` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5487-L5489) -function minetest.add_particle(particle_definition) end +function core.add_particle(particle_definition) end --- * Add a `ParticleSpawner`, an object that spawns an amount of particles --- over `time` seconds. --- * Returns an `id`, and -1 if adding didn't succeed ---- * Deprecated: `minetest.add_particlespawner(amount, time, +--- * Deprecated: `core.add_particlespawner(amount, time, --- minpos, maxpos, --- minvel, maxvel, --- minacc, maxacc, @@ -1981,14 +1982,14 @@ function minetest.add_particle(particle_definition) end --- collisiondetection, texture, playername)` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5491-L5501) -function minetest.add_particlespawner(particlespawner_definition) end +function core.add_particlespawner(particlespawner_definition) end --- * Delete `ParticleSpawner` with `id` (return value from ---- `minetest.add_particlespawner`). +--- `core.add_particlespawner`). --- * If playername is specified, only deletes on the player's client, --- otherwise on all clients. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5503-L5507) -function minetest.delete_particlespawner(id, player) end +function core.delete_particlespawner(id, player) end -- Schematics: --- * Create a schematic from the volume of map specified by the box formed by @@ -2020,7 +2021,7 @@ function minetest.delete_particlespawner(id, player) end --- * Saves schematic in the Minetest Schematic format to filename. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5512-L5539) -function minetest.create_schematic(p1, p2, probability_list, filename, slice_prob_list) end +function core.create_schematic(p1, p2, probability_list, filename, slice_prob_list) end --- * Place the schematic specified by schematic (see [Schematic specifier]) at --- `pos`. --- * `rotation` can equal `"0"`, `"90"`, `"180"`, `"270"`, or `"random"`. @@ -2040,8 +2041,8 @@ function minetest.create_schematic(p1, p2, probability_list, filename, slice_pro --- * place_center_z --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5541-L5558) -function minetest.place_schematic(pos, schematic, rotation, replacements, force_placement, flags) end ---- * This function is analogous to minetest.place_schematic, but places a +function core.place_schematic(pos, schematic, rotation, replacements, force_placement, flags) end +--- * This function is analogous to core.place_schematic, but places a --- schematic onto the specified VoxelManip object `vmanip` instead of the --- map. --- * Returns false if any part of the schematic was cut-off due to the @@ -2056,7 +2057,7 @@ function minetest.place_schematic(pos, schematic, rotation, replacements, force_ --- * place_center_z --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5560-L5573) -function minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement, flags) end +function core.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement, flags) end --- * Return the serialized schematic specified by schematic --- (see [Schematic specifier]) --- * in the `format` of either "mts" or "lua". @@ -2073,7 +2074,7 @@ function minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, re --- instead of a tab character. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5575-L5589) -function minetest.serialize_schematic(schematic, format, options) end +function core.serialize_schematic(schematic, format, options) end --- * Returns a Lua table representing the schematic (see: [Schematic specifier]) --- * `schematic` is the schematic to read (see: [Schematic specifier]) --- * `options` is a table containing the following optional parameters: @@ -2086,7 +2087,7 @@ function minetest.serialize_schematic(schematic, format, options) end --- * Any invalid value will be interpreted as `all`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5591-L5601) -function minetest.read_schematic(schematic, options) end +function core.read_schematic(schematic, options) end -- HTTP Requests: --- * returns `HTTPApiTable` containing http functions if the calling mod has @@ -2103,7 +2104,7 @@ function minetest.read_schematic(schematic, options) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5606-L5616) --- --- @return HTTPApiTable -function minetest.request_http_api() end +function core.request_http_api() end -- Storage API: --- * returns reference to mod private `StorageRef` @@ -2111,79 +2112,79 @@ function minetest.request_http_api() end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5630-L5632) --- @return StorageRef -function minetest.get_mod_storage() end +function core.get_mod_storage() end -- Misc.: --- Returns list of `ObjectRefs` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5637-L5637) --- @return Player[] -function minetest.get_connected_players() end +function core.get_connected_players() end --- Boolean, whether `obj` is a player --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5638-L5638) -function minetest.is_player(obj) end +function core.is_player(obj) end --- Boolean, whether player exists --- (regardless of online status) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5639-L5640) ---@param name string ---@return boolean -function minetest.player_exists(name) end +function core.player_exists(name) end --- * Replaces definition of a builtin hud element --- * `name`: `"breath"` or `"health"` --- * `hud_definition`: definition to replace builtin definition --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5641-L5644) -function minetest.hud_replace_builtin(name, hud_definition) end +function core.hud_replace_builtin(name, hud_definition) end --- * This function can be overridden by mods to change the join message. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5645-L5646) -function minetest.send_join_message(player_name) end +function core.send_join_message(player_name) end --- * This function can be overridden by mods to change the leave message. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5647-L5648) -function minetest.send_leave_message(player_name, timed_out) end +function core.send_leave_message(player_name, timed_out) end --- Returns an 48-bit integer --- * `pos`: table {x=number, y=number, z=number}, --- * Gives a unique hash number for a node position (16+16+16=48bit) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5649-L5651) -function minetest.hash_node_position(pos) end +function core.hash_node_position(pos) end --- Returns a position ---- * Inverse transform of `minetest.hash_node_position` +--- * Inverse transform of `core.hash_node_position` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5652-L5653) -function minetest.get_position_from_hash(hash) end +function core.get_position_from_hash(hash) end --- Returns a rating --- * Get rating of a group of an item. (`0` means: not in group) --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5654-L5655) -function minetest.get_item_group(name, group) end +function core.get_item_group(name, group) end --- Returns a rating --- * Deprecated: An alias for the former. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5656-L5657) -function minetest.get_node_group(name, group) end +function core.get_node_group(name, group) end --- Returns a rating --- * Returns rating of the connect_to_raillike group corresponding to name --- * If name is not yet the name of a connect_to_raillike group, a new group --- id is created, with that name. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5658-L5661) -function minetest.raillike_group(name) end +function core.raillike_group(name) end --- Returns an integer --- * Gets the internal content ID of `name` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5662-L5663) --- @param name string --- @return integer -function minetest.get_content_id(name) end +function core.get_content_id(name) end --- Returns a string --- * Gets the name of the content with that content ID --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5664-L5665) -function minetest.get_name_from_content_id(content_id) end +function core.get_name_from_content_id(content_id) end --- Returns something --- * Convert a string containing JSON data into the Lua equivalent --- * `nullvalue`: returned in place of the JSON null; defaults to `nil` @@ -2194,7 +2195,7 @@ function minetest.get_name_from_content_id(content_id) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5666-L5671) ---@param string string ---@param nullvalue any -function minetest.parse_json(string, nullvalue) end +function core.parse_json(string, nullvalue) end --- Returns a string or `nil` and an error --- message. --- * Convert a Lua table into a JSON string @@ -2215,18 +2216,18 @@ function minetest.parse_json(string, nullvalue) end --- @param data table --- @param styled boolean --- @return string|nil -function minetest.write_json(data, styled) end +function core.write_json(data, styled) end --- Returns a string --- * Convert a table containing tables, strings, numbers, booleans and `nil`s ---- into string form readable by `minetest.deserialize` +--- into string form readable by `core.deserialize` --- * Example: `serialize({foo='bar'})`, returns `'return { ["foo"] = "bar" }'` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5686-L5689) --- @param table --- @return string -function minetest.serialize(table) end +function core.serialize(table) end --- Returns a table ---- * Convert a string returned by `minetest.serialize` into a table +--- * Convert a string returned by `core.serialize` into a table --- * `string` is loaded in an empty sandbox environment. --- * Will load functions if safe is false or omitted. Although these functions --- cannot directly access the global environment, they could bypass this @@ -2242,7 +2243,7 @@ function minetest.serialize(table) end --- `error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value)` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5690-L5704) -function minetest.deserialize(string, safe) end +function core.deserialize(string, safe) end --- Returns `compressed_data` --- * Compress a string of data. --- * `method` is a string identifying the compression method to be used. @@ -2253,32 +2254,32 @@ function minetest.deserialize(string, safe) end --- * Deflate: `level` - Compression level, `0`-`9` or `nil`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5705-L5712) -function minetest.compress(data, method, ...) end +function core.compress(data, method, ...) end --- Returns data --- * Decompress a string of data (using ZLib). ---- * See documentation on `minetest.compress()` for supported compression +--- * See documentation on `core.compress()` for supported compression --- methods. --- * `...` indicates method-specific arguments. Currently, no methods use this --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5713-L5717) -function minetest.decompress(compressed_data, method, ...) end +function core.decompress(compressed_data, method, ...) end --- Returns a string --- * Each argument is a 8 Bit unsigned integer --- * Returns the ColorString from rgb or rgba values ---- * Example: `minetest.rgba(10, 20, 30, 40)`, returns `"#0A141E28"` +--- * Example: `core.rgba(10, 20, 30, 40)`, returns `"#0A141E28"` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5718-L5721) -function minetest.rgba(red, green, blue, alpha) end +function core.rgba(red, green, blue, alpha) end --- Returns string encoded in base64 --- * Encodes a string in base64. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5722-L5723) -function minetest.encode_base64(string) end +function core.encode_base64(string) end --- Returns string or nil for invalid base64 --- * Decodes a string encoded in base64. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5724-L5725) -function minetest.decode_base64(string) end +function core.decode_base64(string) end --- Returns boolean --- * Returning `true` restricts the player `name` from modifying (i.e. digging, --- placing) the node at position `pos`. @@ -2289,8 +2290,8 @@ function minetest.decode_base64(string) end --- not protected by the mod. This will allow using multiple protection mods. --- * Example: --- ---- local old_is_protected = minetest.is_protected ---- function minetest.is_protected(pos, name) +--- local old_is_protected = core.is_protected +--- function core.is_protected(pos, name) --- if mymod:position_protected_from(pos, name) then --- return true --- end @@ -2298,12 +2299,12 @@ function minetest.decode_base64(string) end --- end --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5726-L5742) -function minetest.is_protected(pos, name) end +function core.is_protected(pos, name) end --- * This function calls functions registered with ---- `minetest.register_on_protection_violation`. +--- `core.register_on_protection_violation`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5743-L5745) -function minetest.record_protection_violation(pos, name) end +function core.record_protection_violation(pos, name) end --- Returns boolean --- * Returning `true` means that Creative Mode is enabled for player `name`. --- * `name` will be `""` for non-players or if the player is unknown. @@ -2313,7 +2314,7 @@ function minetest.record_protection_violation(pos, name) end --- `creative_mode` is `true` and `false` otherwise. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5746-L5752) -function minetest.is_creative_enabled(name) end +function core.is_creative_enabled(name) end --- * Returns the position of the first node that `player_name` may not modify --- in the specified cuboid between `pos1` and `pos2`. --- * Returns `false` if no protections were found. @@ -2324,12 +2325,12 @@ function minetest.is_creative_enabled(name) end --- * `interval` defaults to 4. --- * `interval` should be carefully chosen and maximised to avoid an excessive --- number of points being checked. ---- * Like `minetest.is_protected`, this function may be extended or +--- * Like `core.is_protected`, this function may be extended or --- overwritten by mods to provide a faster implementation to check the --- cuboid for intersections. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5753-L5766) -function minetest.is_area_protected(pos1, pos2, player_name, interval) end +function core.is_area_protected(pos1, pos2, player_name, interval) end --- * Attempt to predict the desired orientation of the facedir-capable node --- defined by `itemstack`, and place it accordingly (on-wall, on the floor, --- or hanging from the ceiling). @@ -2345,7 +2346,7 @@ function minetest.is_area_protected(pos1, pos2, player_name, interval) end --- when placing on the floor or ceiling. --- * The first four options are mutually-exclusive; the last in the list --- takes precedence over the first. ---- * `prevent_after_place` is directly passed to `minetest.item_place_node` +--- * `prevent_after_place` is directly passed to `core.item_place_node` --- * Returns the new itemstack after placement --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5767-L5785) @@ -2356,7 +2357,7 @@ function minetest.is_area_protected(pos1, pos2, player_name, interval) end --- @param orient_flags {invert_wall:boolean,force_wall:boolean,force_ceiling:boolean,force_floor:boolean,force_facedir:boolean} --- @param prevent_after_place boolean --- @return ItemStack -function minetest.rotate_and_place(itemstack, placer, pointed_thing, infinite_stacks, orient_flags, prevent_after_place) end +function core.rotate_and_place(itemstack, placer, pointed_thing, infinite_stacks, orient_flags, prevent_after_place) end --- * calls `rotate_and_place()` with `infinitestacks` set according to the state --- of the creative mode setting, checks for "sneak" to set the `invert_wall` --- parameter and `prevent_after_place` set to `true`. @@ -2367,7 +2368,7 @@ function minetest.rotate_and_place(itemstack, placer, pointed_thing, infinite_st --- @param placer Player --- @param pointed_thing pointed_thing --- @return ItemStack -function minetest.rotate_node(itemstack, placer, pointed_thing) end +function core.rotate_node(itemstack, placer, pointed_thing) end --- * Returns the amount of knockback applied on the punched player. --- * Arguments are equivalent to `register_on_punchplayer`, except the following: --- * `distance`: distance between puncher and punched player @@ -2376,7 +2377,7 @@ function minetest.rotate_node(itemstack, placer, pointed_thing) end --- change knockback behaviour. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5791-L5798) -function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage) end +function core.calculate_knockback(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage) end --- * forceloads the position `pos`. --- * returns `true` if area could be forceloaded --- * If `transient` is `false` or absent, the forceload will be persistent @@ -2384,13 +2385,13 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, too --- (not saved between server runs). --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5800-L5805) -function minetest.forceload_block(pos, transient) end +function core.forceload_block(pos, transient) end --- * stops forceloading the position `pos` --- * If `transient` is `false` or absent, frees a persistent forceload. --- If `true`, frees a transient forceload. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5807-L5810) -function minetest.forceload_free_block(pos, transient) end +function core.forceload_free_block(pos, transient) end --- Returns an environment containing --- insecure functions if the calling mod has been listed as trusted in the --- `secure.trusted_mods` setting or security is disabled, otherwise returns @@ -2401,42 +2402,42 @@ function minetest.forceload_free_block(pos, transient) end --- IT IN A LOCAL VARIABLE!** --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5812-L5819) -function minetest.request_insecure_environment() end +function core.request_insecure_environment() end --- * Checks if a global variable has been set, without triggering a warning. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5821-L5822) -function minetest.global_exists(name) end +function core.global_exists(name) end --- `EnvRef` of the server environment and world. --- * Any function in the minetest namespace can be called using the syntax ---- `minetest.env:somefunction(somearguments)` ---- instead of `minetest.somefunction(somearguments)` +--- `core.env:somefunction(somearguments)` +--- instead of `core.somefunction(somearguments)` --- * Deprecated, but support is not to be dropped soon --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5827-L5831) --- @type table -minetest.env = {} +core.env = {} --- * Map of registered items, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5838-L5839) --- @type table -minetest.registered_items = {} +core.registered_items = {} --- * Map of registered node definitions, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5840-L5841) --- @type table -minetest.registered_nodes = {} +core.registered_nodes = {} --- * Map of registered craft item definitions, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5842-L5843) --- @type table -minetest.registered_craftitems = {} +core.registered_craftitems = {} --- * Map of registered tool definitions, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5844-L5845) --- @type table -minetest.registered_tools = {} +core.registered_tools = {} --- * Map of registered entity prototypes, indexed by name --- * Values in this table may be modified directly. --- Note: changes to initial properties will only affect entities spawned afterwards, @@ -2444,71 +2445,71 @@ minetest.registered_tools = {} --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5846-L5850) --- @type table|EntityDefinition[] -minetest.registered_entities = {} +core.registered_entities = {} --- * Map of object references, indexed by active object id --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5851-L5852) --- @type table -minetest.object_refs = {} +core.object_refs = {} --- * Map of Lua entities, indexed by active object id --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5853-L5854) --- @type table -minetest.luaentities = {} +core.luaentities = {} --- * List of ABM definitions --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5855-L5856) --- @type table -minetest.registered_abms = {} +core.registered_abms = {} --- * List of LBM definitions --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5857-L5858) --- @type table -minetest.registered_lbms = {} +core.registered_lbms = {} --- * Map of registered aliases, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5859-L5860) --- @type table -minetest.registered_aliases = {} +core.registered_aliases = {} --- * Map of registered ore definitions, indexed by the `name` field. --- * If `name` is nil, the key is the object handle returned by ---- `minetest.register_ore`. +--- `core.register_ore`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5861-L5864) --- @type table -minetest.registered_ores = {} +core.registered_ores = {} --- * Map of registered biome definitions, indexed by the `name` field. --- * If `name` is nil, the key is the object handle returned by ---- `minetest.register_biome`. +--- `core.register_biome`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5865-L5868) --- @type table -minetest.registered_biomes = {} +core.registered_biomes = {} --- * Map of registered decoration definitions, indexed by the `name` field. --- * If `name` is nil, the key is the object handle returned by ---- `minetest.register_decoration`. +--- `core.register_decoration`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5869-L5872) --- @type table -minetest.registered_decorations = {} +core.registered_decorations = {} --- * Map of registered schematic definitions, indexed by the `name` field. --- * If `name` is nil, the key is the object handle returned by ---- `minetest.register_schematic`. +--- `core.register_schematic`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5873-L5876) --- @type table -minetest.registered_schematics = {} +core.registered_schematics = {} --- * Map of registered chat command definitions, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5877-L5878) --- @type table -minetest.registered_chatcommands = {} +core.registered_chatcommands = {} --- * Map of registered privilege definitions, indexed by name --- * Registered privileges can be modified directly in this table. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5879-L5881) --- @type table -minetest.registered_privileges = {} +core.registered_privileges = {} diff --git a/core_namespace/utilities.lua b/core_namespace/utilities.lua index 50f2935..1e86274 100644 --- a/core_namespace/utilities.lua +++ b/core_namespace/utilities.lua @@ -6,11 +6,11 @@ --- its top-level scope, or from a function called during mod loading). --- - Useful for libraries to determine which mod is loading them, for --- example to access that mod's mod storage. ---- @see minetest.get_modpath ---- @see minetest.get_modnames ---- @see minetest.get_worldpath +--- @see core.get_modpath +--- @see core.get_modnames +--- @see core.get_worldpath --- @return string returns the currently loading mod's name, when loading a mod. -function minetest.get_current_modname() end +function core.get_current_modname() end --- Returns the directory path for a mod, e.g. "/home/user/.minetest/usermods/modname". --- - Returns nil if the mod is not enabled or does not exist (not installed). @@ -18,12 +18,12 @@ function minetest.get_current_modname() end --- - Useful for loading additional `.lua` modules or static data from a mod, or checking if a mod is enabled. --- @param mod_name string --- @return string -function minetest.get_modpath(mod_name) end +function core.get_modpath(mod_name) end --- Returns a list of enabled mods, sorted alphabetically. --- - Does not include disabled mods, even if they are installed. --- @return table -function minetest.get_modnames() end +function core.get_modnames() end --- @class GameInfo --- @field id string @@ -36,12 +36,12 @@ function minetest.get_modnames() end --- can be manually read from `game.conf` in the game's root directory. --- --- @return GameInfo -function minetest.get_game_info() end +function core.get_game_info() end --- Returns e.g. "/home/user/.minetest/world" --- - Useful for storing custom data --- @return string -function minetest.get_worldpath() end +function core.get_worldpath() end --- Returns e.g. "/home/user/.minetest/mod_data/mymod" --- - Useful for storing custom data independently of worlds. @@ -49,15 +49,15 @@ function minetest.get_worldpath() end --- - Can read or write to this directory at any time. --- - It's possible that multiple Minetest instances are running at the same time, which may lead to corruption if you are not careful. --- @return string -function minetest.get_mod_data_path() end +function core.get_mod_data_path() end --- @return boolean -function minetest.is_singleplayer() end +function core.is_singleplayer() end --- Table containing API feature flags --- @type table -minetest.features = { +core.features = { --- @since 0.4.7 glasslike_framed = true, --- @since 0.4.7 @@ -98,7 +98,7 @@ minetest.features = { --- Whether AreaStore's IDs are kept on save/load --- @since 5.1.0 area_store_persistent_ids = true, - --- Whether minetest.find_path is functional + --- Whether core.find_path is functional --- @since 5.2.0 pathfinder_works = true, --- Whether Collision info is available to an objects' on_step @@ -156,7 +156,7 @@ minetest.features = { --- PcgRandom has get_state and set_state methods --- @since 5.9.0 random_state_restore = true, - --- minetest.after guarantees that coexisting jobs are executed primarily + --- core.after guarantees that coexisting jobs are executed primarily --- in order of expiry and secondarily in order of registration --- @since 5.9.0 after_order_expiry_registration = true, @@ -183,13 +183,13 @@ minetest.features = { --- @since 5.9.0 item_meta_range = true, --- Allow passing an optional "actor" ObjectRef to the following functions: - --- minetest.place_node, minetest.dig_node, minetest.punch_node + --- core.place_node, core.dig_node, core.punch_node --- @since 5.9.0 node_interaction_actor = true, --- "new_pos" field in entity moveresult --- @since 5.9.0 moveresult_new_pos = true, - --- Allow removing definition fields in `minetest.override_item` + --- Allow removing definition fields in `core.override_item` override_item_remove_fields = true, } @@ -198,7 +198,7 @@ minetest.features = { --- * `missing_features`: `{foo=true, bar=true}` --- @param arg string|table --- @return boolean,table -function minetest.has_feature(arg) end +function core.has_feature(arg) end --- Table containing information --- about a player. Example return value: @@ -228,7 +228,7 @@ function minetest.has_feature(arg) end --- } --- ``` --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4400-L4425) -function minetest.get_player_information(player_name) end +function core.get_player_information(player_name) end --- Will only be present if the client sent this information (requires v5.7+) @@ -273,14 +273,14 @@ function minetest.get_player_information(player_name) end --- touch_controls = false, --- } --- ``` -function minetest.get_player_window_information(player_name) end +function core.get_player_window_information(player_name) end --- Returns success. --- * Creates a directory specified by `path`, creating parent directories --- if they don't exist. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4427-L4429) -function minetest.mkdir(path) end +function core.mkdir(path) end --- Removes a directory specified by path. --- If recursive is set to true, the directory is recursively removed. Otherwise, the directory will only be removed if it is empty. @@ -288,7 +288,7 @@ function minetest.mkdir(path) end --- @param path string --- @param recursive boolean --- @return boolean -function minetest.rmdir(path, recursive) end +function core.rmdir(path, recursive) end --- Copies a directory specified by path to destination @@ -297,7 +297,7 @@ function minetest.rmdir(path, recursive) end --- @param source string --- @param destination string --- @return boolean -function minetest.cpdir(source, destination) end +function core.cpdir(source, destination) end --- Moves a directory specified by path to destination. @@ -306,7 +306,7 @@ function minetest.cpdir(source, destination) end --- @param source string --- @param destination string --- @return boolean -function minetest.mvdir(source, destination) end +function core.mvdir(source, destination) end --- Returns list of entry names --- * `is_dir` [Optional] is one of: @@ -315,7 +315,7 @@ function minetest.mvdir(source, destination) end --- * false: return only file names. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4430-L4434) -function minetest.get_dir_list(path, is_dir) end +function core.get_dir_list(path, is_dir) end --- Returns boolean indicating success --- * Replaces contents of file at path with new contents in a safe (atomic) @@ -323,7 +323,7 @@ function minetest.get_dir_list(path, is_dir) end --- `local f = io.open(path, "wb"); f:write(content); f:close()` --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4435-L4438) -function minetest.safe_file_write(path, content) end +function core.safe_file_write(path, content) end --- Returns a table containing components of the --- engine version. Components: @@ -336,34 +336,34 @@ function minetest.safe_file_write(path, content) end --- reliable or verifiable. Compatible forks will have a different name and --- version entirely. To check for the presence of engine features, test --- whether the functions exported by the wanted features exist. For example: ---- `if minetest.check_for_falling then ... end`. +--- `if core.check_for_falling then ... end`. --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4439-L4450) -function minetest.get_version() end +function core.get_version() end --- Returns the sha1 hash of data --- * `data`: string of data to hash --- * `raw`: [Optional] return raw bytes instead of hex digits, default: false --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4451-L4453) -function minetest.sha1(data, raw) end +function core.sha1(data, raw) end --- Returns the sha256 hash of `data` --- @param data string string of data to hash --- @param raw boolean optional. return raw bytes instead of hex digits, default: false -function minetest.sha256(data, raw) end +function core.sha256(data, raw) end --- Converts a ColorSpec to a ColorString. If the ColorSpec is invalid, returns `nil`. --- @param colorspec ColorSpec The ColorSpec to convert. --- @return ColorString? -function minetest.colorspec_to_colorstring(colorspec) end +function core.colorspec_to_colorstring(colorspec) end --- Converts a ColorSpec to a raw string of four bytes in an RGBA layout, returned as a string. --- @param colorspec ColorSpec The ColorSpec to convert. --- @return string? -function minetest.colorspec_to_bytes(colorspec) end +function core.colorspec_to_bytes(colorspec) end --- Converts a ColorSpec into RGBA table form. If the ColorSpec is invalid, returns nil. You can use this to parse ColorStrings. --- @param colorspec ColorSpec The ColorSpec to convert. --- @return {r:number, g:number, b:number, a:number}? -function minetest.colorspec_to_table(colorspec) end +function core.colorspec_to_table(colorspec) end diff --git a/definitions/AuthenticationHandlerDefinition.lua b/definitions/AuthenticationHandlerDefinition.lua index 0f8a43f..a63d733 100644 --- a/definitions/AuthenticationHandlerDefinition.lua +++ b/definitions/AuthenticationHandlerDefinition.lua @@ -6,7 +6,7 @@ ---@field privileges table ---@field last_login number|nil --- Used by `minetest.register_authentication_handler`. +-- Used by `core.register_authentication_handler`. ---@class AuthenticationHandlerDefinition local AuthenticationHandlerDefinition = { --- Get authentication data for existing player `name` (`nil` if player diff --git a/definitions/ChatCommandDefinition.lua b/definitions/ChatCommandDefinition.lua index 49d4cfe..48b0c3c 100644 --- a/definitions/ChatCommandDefinition.lua +++ b/definitions/ChatCommandDefinition.lua @@ -1,7 +1,8 @@ --- @diagnostic disable: missing-return ---- Used by `minetest.register_chatcommand`. +--- Used by `core.register_chatcommand`. +--- @see core.register_chatcommand --- @class ChatCommandDefinition local ChatCommandDefinition = { --- Short parameter description. Example: `" "`. diff --git a/definitions/EntityDefinition.lua b/definitions/EntityDefinition.lua index a20adef..cbdcfd4 100644 --- a/definitions/EntityDefinition.lua +++ b/definitions/EntityDefinition.lua @@ -2,7 +2,7 @@ --- Used by `core.register_entity`. ---- The entity definition table becomes a metatable of a newly created per-entity luaentity table, +--- The entity definition table becomes a metatable of a newly created per-entity luaentity table, --- meaning its fields (e.g. initial_properties) will be shared between all instances of an entity. --- @class EntityDefinition local EntityDefinition = { @@ -22,8 +22,8 @@ local EntityDefinition = { --- Calling `object:remove()` on an active object will call this with `removal=true`. --- The mapblock the entity resides in being unloaded will call this with `removal=false`. --- * Note that this won't be called if the object hasn't been activated in the first place. - --- In particular, `minetest.clear_objects({mode = "full"})` won't call this, - --- whereas `minetest.clear_objects({mode = "quick"})` might call this. + --- In particular, `core.clear_objects({mode = "full"})` won't call this, + --- whereas `core.clear_objects({mode = "quick"})` might call this. --- @param removal boolean on_deactivate = function(self, removal) end, --- * Called on every server tick, after movement and collision processing. diff --git a/definitions/ItemDefinition.lua b/definitions/ItemDefinition.lua index 90d0b39..b8d758f 100644 --- a/definitions/ItemDefinition.lua +++ b/definitions/ItemDefinition.lua @@ -72,8 +72,8 @@ local ItemDefinition = { --- When used for nodes: Defines amount of light emitted by node. --- Otherwise: Defines texture glow when viewed as a dropped item - --- To set the maximum (14), use the value 'minetest.LIGHT_MAX'. - --- A value outside the range 0 to minetest.LIGHT_MAX causes undefined + --- To set the maximum (14), use the value 'core.LIGHT_MAX'. + --- A value outside the range 0 to core.LIGHT_MAX causes undefined --- behavior. --- @type number? light_source = 0, @@ -152,7 +152,7 @@ local ItemDefinition = { --- Definition of item sounds to be played at various events. --- All fields in this table are optional. - --- See also `minetest.registered_items[itemname].sound` + --- See also `core.registered_items[itemname].sound` --- @type table? sound = { @@ -160,7 +160,7 @@ local ItemDefinition = { --- @type SimpleSoundSpec breaks = nil, - --- When item is eaten with `minetest.do_item_eat` + --- When item is eaten with `core.do_item_eat` --- @type SimpleSoundSpec eat = nil, @@ -177,9 +177,9 @@ local ItemDefinition = { --- Shall place item and return the leftover itemstack or nil to not modify the inventory. --- Second return value: position of placed item/node. --- The placer may be any ObjectRef or nil. - --- default: minetest.item_place + --- default: core.item_place --- @type (fun(itemstack:ItemStack, placer:Player|ObjectRef|nil, pointed_thing:pointed_thing):ItemStack|nil, Position|vector|nil)? - on_place = minetest.item_place, + on_place = core.item_place, --- Same as on_place but called when not pointing at a node. --- Function must return either nil if inventory shall not be modified, @@ -191,9 +191,9 @@ local ItemDefinition = { --- Shall drop item and return the leftover itemstack. --- The dropper may be any ObjectRef or nil. - --- default: minetest.item_drop + --- default: core.item_drop --- @type (fun(itemstack:ItemStack|ItemStackString, dropper:Player|ObjectRef|nil, pos:Position):ItemStack)? - on_drop = minetest.item_drop, + on_drop = core.item_drop, --- Called when a dropped item is punched by a player. --- Shall pick-up the item and return the leftover itemstack or nil to not @@ -205,9 +205,9 @@ local ItemDefinition = { --- luaentity) as `type="object"` `pointed_thing`. --- * `time_from_last_punch, ...` (optional): Other parameters from --- `luaentity:on_punch`. - --- default: `minetest.item_pickup` + --- default: `core.item_pickup` --- @type fun(itemstack:ItemStack, picker:Player|ObjectRef|nil, pointed_thing:pointed_thing, time_from_last_punch, ...)? - on_pickup = minetest.item_pickup, + on_pickup = core.item_pickup, --- default: nil --- When user pressed the 'punch/mine' key with the item in hand. diff --git a/definitions/NodeDefinition.lua b/definitions/NodeDefinition.lua index 6b704e3..7a1b2d0 100644 --- a/definitions/NodeDefinition.lua +++ b/definitions/NodeDefinition.lua @@ -327,7 +327,7 @@ local NodeDefinition = { leveled = 0, --- Maximum value for `leveled` (0-127), enforced in - --- `minetest.set_node_level` and `minetest.add_node_level`. + --- `core.set_node_level` and `core.add_node_level`. --- Values above 124 might causes collision detection issues. --- @type number? leveled_max = 127, @@ -497,9 +497,9 @@ local NodeDefinition = { --- Node constructor; called after adding node. --- Can set up metadata and stuff like that. --- Not called for bulk node placement (i.e. schematics and `VoxelManip`). - --- Note: Within an on_construct callback, minetest.set_node can cause an + --- Note: Within an on_construct callback, core.set_node can cause an --- infinite loop if it invokes the same callback. - --- Consider using `minetest.swap_node()` instead. + --- Consider using `core.swap_node()` instead. --- default: nil --- @type fun(pos:Position)? on_construct = nil, @@ -540,7 +540,7 @@ local NodeDefinition = { preserve_metadata = nil, --- Called after constructing node when node was placed using - --- minetest.item_place_node / minetest.place_node. + --- core.item_place_node / core.place_node. --- If return true no item is taken from itemstack. --- `placer` may be any valid ObjectRef or nil. --- default: nil @@ -549,7 +549,7 @@ local NodeDefinition = { --- oldmetadata is in table format. --- Called after destructing node when node was dug using - --- minetest.node_dig / minetest.dig_node. + --- core.node_dig / core.dig_node. --- default: nil --- @type fun(pos:Player, oldnode, oldmetadata, digger:Player|ObjectRef|nil)? after_dig_node = nil, @@ -559,9 +559,9 @@ local NodeDefinition = { --- @type fun(pos:Position, player:Player|ObjectRef|nil)? can_dig = nil, - --- default: minetest.node_punch + --- default: core.node_punch --- Called when puncher (an ObjectRef) punches the node at pos. - --- By default calls minetest.register_on_punchnode callbacks. + --- By default calls core.register_on_punchnode callbacks. --- @type fun(pos:Position, node:NodeTable, puncher:Player|ObjectRef|nil, pointed_thing:pointed_thing)? on_punch = nil, @@ -577,7 +577,7 @@ local NodeDefinition = { --- @type (fun(pos:Position, node:NodeTable, clicker:Player|ObjectRef, itemstack:ItemStack, pointed_thing:pointed_thing|nil):ItemStack|nil)? on_rightclick = core.node_punch, - --- default: minetest.node_dig + --- default: core.node_dig --- By default checks privileges, wears out item (if tool) and removes node. --- return true if the node was dug successfully, false otherwise. --- Deprecated: returning nil is the same as returning true. @@ -585,7 +585,7 @@ local NodeDefinition = { on_dig = nil, --- default: nil - --- called by NodeTimers, see minetest.get_node_timer and NodeTimerRef. + --- called by NodeTimers, see core.get_node_timer and NodeTimerRef. --- elapsed is the total time passed since the timer was started. --- return true to run the timer for another cycle with the same timeout --- value. @@ -594,7 +594,7 @@ local NodeDefinition = { --- fields = {name1 = value1, name2 = value2, ...} --- Called when an UI form (e.g. sign text input) returns data. - --- See minetest.register_on_player_receive_fields for more info. + --- See core.register_on_player_receive_fields for more info. --- default: nil --- @type fun(pos:Position, formname:string, fields:table, sender:Player)? on_receive_fields = nil, diff --git a/definitions/ObjectProperties.lua b/definitions/ObjectProperties.lua index a80383d..f04c9c6 100644 --- a/definitions/ObjectProperties.lua +++ b/definitions/ObjectProperties.lua @@ -2,11 +2,11 @@ local ObjectProperties = { --- Defines the maximum and default HP of the entity --- For Lua entities the maximum is not enforced. - --- For players this defaults to `minetest.PLAYER_MAX_HP_DEFAULT`. + --- For players this defaults to `core.PLAYER_MAX_HP_DEFAULT`. --- @type number hp_max = 10, - --- For players only. Defaults to `minetest.PLAYER_MAX_BREATH_DEFAULT`. + --- For players only. Defaults to `core.PLAYER_MAX_BREATH_DEFAULT`. --- @type number breath_max = 0, @@ -73,7 +73,7 @@ local ObjectProperties = { --- Otherwise for non-node items, the object will be an extrusion of --- 'inventory_image'. --- If 'itemname' contains a ColorString or palette index (e.g. from - --- `minetest.itemstring_with_palette()`), the entity will inherit the color. + --- `core.itemstring_with_palette()`), the entity will inherit the color. --- Wielditems are scaled a bit. If you want a wielditem to appear --- to be as large as a node, use `0.667` in `visual_size` --- "item" is similar to "wielditem" but ignores the 'wield_image' parameter. diff --git a/specs/SimpleSoundSpec.lua b/specs/SimpleSoundSpec.lua index 5b9314a..f16335a 100644 --- a/specs/SimpleSoundSpec.lua +++ b/specs/SimpleSoundSpec.lua @@ -42,7 +42,7 @@ local SimpleSoundSpec = { --- For death sounds, prefer playing a positional sound instead. --- --- If you want to stop a sound when an entity dies or is deactivated, - --- store the handle and call `minetest.sound_stop` in `on_die` / `on_deactivate`. + --- store the handle and call `core.sound_stop` in `on_die` / `on_deactivate`. --- --- Ephemeral sounds are entirely unaffected by the object being removed --- or leaving the active object range. diff --git a/specs/TextureModifier.lua b/specs/TextureModifier.lua index 9ddfdc4..3cb83d1 100644 --- a/specs/TextureModifier.lua +++ b/specs/TextureModifier.lua @@ -1,5 +1,5 @@ --- **Texture overlaying:** `^`. --- **Texture grouping:** `(` and `)`. ---- See more: https://api.minetest.net/textures/#texture-modifiers +--- See more: https://api.luanti.org/textures/#texture-modifiers --- @class TextureModifier: string