Change namespace minetest. -> core..
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--- @diagnostic disable: missing-return
|
||||
--- @meta
|
||||
|
||||
|
||||
---@class Entity: ObjectRef
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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<string,boolean>
|
||||
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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
---@field privileges table<string,number>
|
||||
---@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
|
||||
|
||||
@@ -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: `"<name> <privilege>"`.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<string,SimpleSoundSpec>?
|
||||
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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user