Change namespace minetest. -> core..

This commit is contained in:
Alexander Chibrikin
2026-01-21 11:01:25 +03:00
parent 52c171aced
commit 71832e5838
16 changed files with 433 additions and 431 deletions

View File

@@ -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

View File

@@ -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>"`.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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,

View File

@@ -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.