Move all annotation files into library/ folder (for LuaLS/LLS-Addons).

This commit is contained in:
Alexander Chibrikin
2025-10-07 22:31:30 +03:00
parent f354d6bd0c
commit 61337d5f3d
43 changed files with 0 additions and 0 deletions

View File

@@ -1,58 +0,0 @@
--- @diagnostic disable: missing-return
--- `AreaStore` is a data structure to calculate intersections of 3D cuboid volumes and points.
--- Despite its name, mods must take care of persisting AreaStore data. They may use the provided load and write functions for this.
--- @class AreaStore
--- @field data string may be used to store and retrieve any mod-relevant information to the specified area.
AreaStore = {}
---@param type_name string|nil optional, forces the internally used API. Possible values: "LibSpatial" (default). When other values are specified, or SpatialIndex is not available, the custom Minetest functions are used.
---@return AreaStore Returns a new AreaStore instance
function AreaStore:AreaStore(type_name) end
---@param id any type not specified in docs
---@param include_corners boolean whether to include corner info in return table or not
---@param include_data boolean whether to include data info in return table or not
---@return nil|boolean|table Returns the area information about the specified ID.
---Returned values are either of these:
---```lua
---nil -- Area not found
---true -- Without `include_corners` and `include_data`
---{
--- min = pos, max = pos -- `include_corners == true`
--- data = string -- `include_data == true`
---}
---```
function AreaStore:get_area(id, include_corners, include_data) end
---Returns all areas as table, indexed by the area ID.
---Table values: see get_area.
function AreaStore:get_areas_for_pos(pos, include_corners, include_data) end
---Returns all areas that contain all nodes inside the area specified bycorner1 and corner2 (inclusive).
---accept_overlap: if true, areas are returned that have nodes in common (intersect) with the specified area.
---Returns the same values as get_areas_for_pos.
function AreaStore:get_areas_in_area(corner1, corner2, accept_overlap, include_corners, include_data) end
---inserts an area into the store.
---
---Returns the new area's ID, or nil if the insertion failed.
--- The (inclusive) positions corner1 and corner2 describe the area.
--- data is a string stored with the area.
--- id (optional): will be used as the internal area ID if it is a unique number between 0 and 2^32-2.
function AreaStore:insert_area(corner1, corner2, data, id) end
---Requires SpatialIndex, no-op function otherwise.
--- Reserves resources for count many contained areas to improve efficiency when working with many area entries. Additional areas can still be inserted afterwards at the usual complexity.
function AreaStore:reserve(count) end
---removes the area with the given id from the store, returns success.
function AreaStore:remove_area(id) end
---sets params for the included prefiltering cache. Calling invalidates the cache, so that its elements have to be newly generated.
---
--- params is a table with the following fields:
---
--- enabled = boolean, -- Whether to enable, default true block_radius = int, -- The radius (in nodes) of the areas the cache -- generates prefiltered lists for, minimum 16, -- default 64 limit = int, -- The cache size, minimum 20, default 1000 * to_string(): Experimental. Returns area store serialized as a (binary) string. * to_file(filename): Experimental. Like to_string(), but writes the data to a file. * from_string(str): Experimental. Deserializes string and loads it into the AreaStore. Returns success and, optionally, an error message. * from_file(filename): Experimental. Like from_string(), but reads the data from a file.
function AreaStore:set_cache_params(params) end

View File

@@ -1,26 +0,0 @@
--- @diagnostic disable: missing-return
--- @class HTTPRequestHandle
--- @class HTTPApiTable
local HTTPApiTable = {}
--- Performs given request asynchronously and calls callback upon completion.
--- Use this HTTP function if you are unsure, the others are for advanced use.
---
--- @param request HTTPRequest
--- @param callback fun(result:HTTPRequestResult)
function HTTPApiTable.fetch(request, callback) end
--- Performs given request asynchronously and returns handle for `HTTPApiTable.fetch_async_get()`.
---
--- @param request HTTPRequest
--- @return HTTPRequestHandle
function HTTPApiTable.fetch_async(request) end
--- Return response data for given asynchronous HTTP request.
---
--- @param handle HTTPRequestHandle
--- @return HTTPRequestResult
function HTTPApiTable.fetch_async_get(handle) end

View File

@@ -1,89 +0,0 @@
--- @diagnostic disable: missing-return
--- @class InvRef
InvRef = {}
--- return true if list is empty
--- @param list_name string
--- @return boolean
function InvRef:is_empty(list_name) end
--- get size of a list
--- @param list_name string
--- @return number
function InvRef:get_size(list_name) end
--- set size of a list, avoid e.g. , 7*3), use , 21) --7*3 instead to avoid confusion with formspec#list
--- @param list_name string
--- @param size number
--- @return boolean returns `false` on error (e.g. invalid `listname` or `size`)
function InvRef:set_size(list_name, size) end
--- get width of a list
--- @param list_name string
--- @return number
function InvRef:get_width(list_name) end
--- set width of list; currently used for crafting
--- @param list_name string
--- @param width number
function InvRef:set_width(list_name, width) end
--- get a copy of stack index i in list
--- @param list_name string
--- @param i number
--- @return ItemStack
function InvRef:get_stack(list_name, i) end
--- copy stack to index i in list
--- @param list_name string
--- @param i number
--- @param stack ItemStack?
function InvRef:set_stack(list_name, i, stack) end
--- return full list
--- @param list_name string
--- @return ItemStack[]
function InvRef:get_list(list_name) end
--- set full list (size will not change)
--- @param list_name string
--- @param list ItemStack[]|table<number,ItemStack>
function InvRef:set_list(list_name, list) end
--- return full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
--- @return ItemStack[][]|table<string,ItemStack[]>|table<string,table<number,ItemStack>>
function InvRef:get_lists() end
--- set full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
--- @param lists ItemStack[][]|table<string,ItemStack[]>|table<string,table<number,ItemStack>>
function InvRef:set_lists(lists) end
--- add item somewhere in list, returns leftover ItemStack
--- @param list_name string
--- @param stack ItemStack|ItemStackString
--- @return ItemStack leftover ItemStack
function InvRef:add_item(list_name, stack) end
--- returns true if the stack of items can be fully added to the list
--- @param list_name string
--- @param stack ItemStack|ItemStackString
---
--- @return boolean
function InvRef:room_for_item(list_name, stack) end
--- returns true if the stack of items can be fully taken from the list
--- @overload fun(list_name:string, stack:ItemStack):boolean
--- @param list_name string
--- @param stack ItemStack|ItemStackString
--- @param match_meta? boolean If `match_meta` is false, only the items' names are compared (default: `false`).
--- @return boolean
function InvRef:contains_item(list_name, stack, match_meta) end
--- Take as many items as specified from the list, returns the items that were actually removed (as an ItemStack).
--- - If match_meta is true (available since feature `remove_item_match_meta`), item metadata is also considered when comparing items.
--- Otherwise, only the items names are compared. Default: `false``
--- - The method ignores wear.
---
--- @param list_name string
--- @param stack ItemStack|ItemStackString
--- @param match_meta? boolean since `remove_item_match_meta`
---
--- @return ItemStack
function InvRef:remove_item(list_name, stack, match_meta) end
--- returns a location compatible to `minetest.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
--- @return table
function InvRef:get_location() end

View File

@@ -1,113 +0,0 @@
--- @diagnostic disable: missing-return
--- @class ItemStack
ItemStack = {}
--- @class ItemStackTable: table
--- @field name string
--- @field count number
--- @field wear number
--- @field metadata string
--- @alias ItemStackString string
--- Put some item or stack onto this stack, returns leftover ItemStack
--- @param item ItemStack|ItemStackString|ItemStackTable
--- @return self
function ItemStack:add_item(item) end
--- Increases wear by amount if the item is a tool, otherwise does nothing.
--- Wear is only added if the item is a tool. Adding wear might destroy the item.
--- @param amount number Valid amount range is [0,65536]
--- @return boolean Returns true if the item is (or was) a tool.
function ItemStack:add_wear(amount) end
--- Removes all items from the stack, making it empty
--- @return boolean it seams that it always return `true`
function ItemStack:clear() end
--- Returns number of items on the stack
--- @return number
function ItemStack:get_count() end
--- Returns true/false (success), clears item on failure
--- @param count number count > 0 && count <= 65535 -- or clears
--- @return boolean
function ItemStack:set_count(count) end
--- @return ItemDefinition returns the item definition table
function ItemStack:get_definition() end
--- Returns get_stack_max() - get_count()
--- @return number
function ItemStack:get_free_space() end
--- @return MetaDataRef
function ItemStack:get_meta() end
--- Returns a string, for compatibility reasons this is equal to get_meta():get_string("")
--- @deprecated
function ItemStack:get_metadata() end
--- Returns item name (e.g. "default:stone")
--- @return string
function ItemStack:get_name() end
--- Returns true/false (success), clears item on failure
--- @param item_name string
--- @return boolean
function ItemStack:set_name(item_name) end
--- Returns the maximum size of the stack (depends on the item)
--- @return number
function ItemStack:get_stack_max() end
--- Returns the digging properties of the item, or those of the hand if none are defined for this item type
--- @return table
function ItemStack:get_tool_capabilities() end
--- Returns tool wear (0-65535), 0 for non-tools
--- @return number
function ItemStack:get_wear() end
--- Returns true/false (success), clears item on failure
--- @param wear number wear <= 65535, otherwise clears
--- @return boolean
function ItemStack:set_wear(wear) end
--- Return true if stack is empty
--- @return boolean
function ItemStack:is_empty() end
--- Returns true if the item name refers to a defined item type
--- @return boolean
function ItemStack:is_known() end
--- Returns true if item or stack can be fully added to this one
--- @param item ItemStack|ItemStackString|ItemStackTable
--- @return boolean
function ItemStack:item_fits(item) end
--- Copy (don't remove) up to n items from this stack; returns copied ItemStack; if n is omitted, n=1 is used
--- @param count number
--- @return ItemStack
function ItemStack:peek_item(count) end
--- Replace the contents of this stack (item can also be an itemstring or table)
--- @param item ItemStack|ItemStackString|ItemStackTable
--- @return boolean seams always `true`
function ItemStack:replace(item) end
--- Take (and remove) up to n items from this stack; returns taken ItemStack; if n is omitted, n=1 is used
--- @param count number
--- @return ItemStack
function ItemStack:take_item(count) end
--- Returns the stack in itemstring form
--- @return string
function ItemStack:to_string() end
--- Returns the stack in Lua table form or `nil` if empty.
--- @return table|nil
function ItemStack:to_table() end

View File

@@ -1,6 +0,0 @@
--- @class LuaEntity
--- @field name string
--- @field object Entity
LuaEntity = {
}

View File

@@ -1,70 +0,0 @@
--- @diagnostic disable: missing-return
--- Base class used by [`StorageRef`], [`NodeMetaRef`], [`ItemStackMetaRef`],
--- and [`PlayerMetaRef`].
---
--- Note: If a metadata value is in the format `${k}`, an attempt to get the value
--- will return the value associated with key `k`. There is a low recursion limit.
--- This behavior is **deprecated** and will be removed in a future version. Usage
--- of the `${k}` syntax in formspecs is not deprecated.
---
--- @class MetaDataRef
MetaDataRef = {}
---@param key string
---@return boolean|nil
function MetaDataRef:contains(key) end
---@param key string
---@return string|nil
function MetaDataRef:get(key) end
---@param key string
---@param value string value "" will delete the key
---@return string
function MetaDataRef:set_string(key, value) end
---@param key string
---@return string
function MetaDataRef:get_string(key) end
---@param key string
---@param value number
---@return number
function MetaDataRef:set_int(key, value) end
---@param key string
---@return number Returns `0` if `key` not present.
function MetaDataRef:get_int(key) end
---@param key string
---@param value number
---@return number
function MetaDataRef:set_float(key, value) end
---@param key string
---@return number
function MetaDataRef:get_float(key) end
--- Returns a list of all keys in the metadata.
--- @return table
function MetaDataRef:get_keys() end
--- returns `nil` or a table with keys:
--- * `fields`: key-value storage
--- * `inventory`: `{list1 = {}, ...}}` (NodeMetaRef only)
--- @return table|nil
function MetaDataRef:to_table() end
--- * Any non-table value will clear the metadata
--- * See [Node Metadata] for an example
--- * returns `true` on success
--- @param value table|nil
--- @return boolean
function MetaDataRef:from_table(value) end
--- * returns `true` if this metadata has the same key-value pairs as `other`
--- @param other any
--- @return boolean
function MetaDataRef:equals(other) end

View File

@@ -1,9 +0,0 @@
--- ItemStack metadata: reference extra data and functionality stored in a stack.
--- Can be obtained via `item:get_meta()`.
---
--- @class ItemStackMetaRef: MetaDataRef
ItemStackMetaRef = {}
--- * Overrides the item's tool capabilities
--- * A nil value will clear the override data and restore the original behavior.
function ItemStackMetaRef:set_tool_capabilities(tool_capabilities) end

View File

@@ -1,19 +0,0 @@
--- @diagnostic disable: missing-return
--- Node metadata: reference extra data and functionality stored in a node.
--- Can be obtained via `minetest.get_meta(pos)`.
---
--- @class NodeMetaRef: MetaDataRef
NodeMetaRef = {}
--- @return InvRef
function NodeMetaRef:get_inventory() end
--- Mark specific vars as private.
--- This will prevent them from being sent to the client. Note that the "private"
--- status will only be remembered if an associated key-value pair exists,
--- meaning it's best to call this when initializing all other meta (e.g.
--- `on_construct`).
--- @param name string|table name or {name1, name2, ...}
function NodeMetaRef:mark_as_private(name) end

View File

@@ -1,7 +0,0 @@
--- Player metadata.
--- Uses the same method of storage as the deprecated player attribute API, so
--- data there will also be in player meta.
--- Can be obtained using `player:get_meta()`.
---
--- @class PlayerMetaRef: MetaDataRef
PlayerMetaRef = {}

View File

@@ -1,8 +0,0 @@
--- Mod metadata: per mod metadata, saved automatically.
--- Can be obtained via `minetest.get_mod_storage()` during load time.
---
--- WARNING: This storage backend is incapable of saving raw binary data due
--- to restrictions of JSON.
---
--- @class StorageRef: MetaDataRef
StorageRef = {}

View File

@@ -1,35 +0,0 @@
--- @diagnostic disable: missing-return
--- Node Timers: a high resolution persistent per-node timer.
--- Can be gotten via `core.get_node_timer(pos)`.
--- @class NodeTimerRef
NodeTimerRef = {}
--- * set a timer's state
--- * will trigger the node's `on_timer` function after `(timeout - elapsed)` seconds.
--- @param timeout number is in seconds, and supports fractional values (0.1 etc)
--- @param elapsed number is in seconds, and supports fractional values (0.1 etc)
function NodeTimerRef:set(timeout, elapsed) end
--- * start a timer.
--- * equivalent to `set(timeout,0)`.
--- @param timeout number is in seconds, and supports fractional values (0.1 etc)
function NodeTimerRef:start(timeout) end
--- stops the timer
function NodeTimerRef:stop() end
--- returns current timeout in seconds
--- * if `timeout` equals `0`, timer is inactive
--- @return number
function NodeTimerRef:get_timeout() end
--- returns current elapsed time in seconds
--- * the node's `on_timer` function will be called after `(timeout - elapsed)` seconds.
--- @return number
function NodeTimerRef:get_elapsed() end
--- returns boolean state of timer
--- * returns `true` if timer is started, otherwise `false`
--- @return boolean
function NodeTimerRef:is_started() end

View File

@@ -1,147 +0,0 @@
--- @diagnostic disable: missing-return
--- @class ObjectRef
ObjectRef = {}
--- @return Position
function ObjectRef:get_pos() end
--- @param pos Position
function ObjectRef:set_pos(pos) end
--TODO:
--- @return vector|Position returns the velocity, a vector.
function ObjectRef:get_velocity() end
--- @param vel vector|Position e.g. `{x=0.0, y=2.3, z=1.0}`
--- * In comparison to using get_velocity, adding the velocity and then using
--- set_velocity, add_velocity is supposed to avoid synchronization problems.
--- Additionally, players also do not support set_velocity.
--- * If a player:
--- * Does not apply during free_move.
--- * Note that since the player speed is normalized at each move step,
--- increasing e.g. Y velocity beyond what would usually be achieved
--- (see: physics overrides) will cause existing X/Z velocity to be reduced.
--- * Example: `add_velocity({x=0, y=6.5, z=0})` is equivalent to
--- pressing the jump key (assuming default settings)
function ObjectRef:add_velocity(vel) end
--- @overload fun(pos)
--- * Does an interpolated move for Lua entities for visually smooth transitions.
--- * If `continuous` is true (default: false), the Lua entity will not be moved to the current
--- position before starting the interpolated move.
--- * For players this does the same as `set_pos`,`continuous` is ignored.
--- @param pos Position
--- @param continuous boolean
function ObjectRef:move_to(pos, continuous) end
--- Punches the object, triggering all consequences a normal punch would have.
--- - Arguments `time_from_last_punch`, `tool_capabilities`, and `direction` will be replaced with a default value when the caller sets them to `nil`.
--- - Other arguments: See on_punch for entities
---
--- @param puncher? ObjectRef|Entity|Player|nil another `ObjectRef` which punched the object or `nil`
--- @param time_from_last_punch? number time since last punch action of the puncher
--- @param tool_capabilities? table the tool capabilities of the puncher. See [Tool Capabilities](https://api.luanti.org/tool-capabilities/)
--- @param direction? Position the direction from which the punch came, normalized vector
function ObjectRef:punch(puncher, time_from_last_punch, tool_capabilities, direction) end
--- @param clicker ObjectRef
function ObjectRef:right_click(clicker) end
--- returns number of health points
--- @return number
function ObjectRef:get_hp() end
--- set number of health points
--- * See reason in register_on_player_hpchange
--- * Is limited to the range of 0 ... 65535 (2^16 - 1)
--- * For players: HP are also limited by `hp_max` specified in object properties
--- @param hp number
--- @param reason PlayerHPChangeReason
function ObjectRef:set_hp(hp, reason) end
--- @return InvRef|nil for players, otherwise returns `nil`
function ObjectRef:get_inventory() end
--- @return string the name of the inventory list the wielded item is in.
function ObjectRef:get_wield_list() end
--- @return number the index of the wielded item
function ObjectRef:get_wield_index() end
--- @return ItemStack
function ObjectRef:get_wielded_item() end
--- replaces the wielded item, returns `true` if successful.
--- @param item ItemStack
--- @return boolean
function ObjectRef:set_wielded_item(item) end
--- @param groups table {group1=rating, group2=rating, ...}
function ObjectRef:set_armor_groups(groups) end
--- @return table with the armor group ratings
function ObjectRef:get_armor_groups() end
--- @param frame_range table {x=num, y=num}, default: `{x=1, y=1}`
--- @param frame_speed number default: `15.0`
--- @param frame_blend number default: `0.0`
--- @param frame_loop boolean default: `true`
function ObjectRef:set_animation(frame_range, frame_speed, frame_blend, frame_loop) end
--- @return table,number,number,boolean `range`, `frame_speed`, `frame_blend` and `frame_loop`.
function ObjectRef:get_animation() end
--- @param frame_speed number default: `15.0`
function ObjectRef:set_animation_frame_speed(frame_speed) end
--- Attaches object to `parent`.
--- See 'Attachments' section for details.
--- This command may fail silently (do nothing) when it would result in circular attachments.
--- @overload fun(parent:ObjectRef)
--- @param parent ObjectRef to attach to
--- @param bone string default `""` (the root bone)
--- @param position Position relative position, default `{x=0, y=0, z=0}`
--- @param rotation Position|vector relative rotation in degrees, default `{x=0, y=0, z=0}`
--- @param forced_visible boolean to control whether the attached entity should appear in first person, default `false`.
function ObjectRef:set_attach(parent, bone, position, rotation, forced_visible) end
--- Returns current attachment parameters or nil if it isn't attached.
--- If attached, returns `parent`, `bone`, `position`, `rotation`, `forced_visible`.
--- @return ObjectRef,string,Position,Position,boolean|nil
function ObjectRef:get_attach() end
--- @return ObjectRef[]|table<number,ObjectRef> a list of ObjectRefs that are attached to the object.
function ObjectRef:get_children() end
function ObjectRef:set_detach() end
---
--- @deprecated
--- @param bone? string Default is `""`, the root bone
--- @param position? Position `{x=num, y=num, z=num}`, relative, `default {x=0, y=0, z=0}`
--- @param rotation? Position `{x=num, y=num, z=num}`, default `{x=0, y=0, z=0}`
function ObjectRef:set_bone_position(bone, position, rotation) end
--- Returns the previously set position and rotation of the bone.
--- - Shorthand for `get_bone_override(bone).position.vec, get_bone_override(bone).rotation.vec:apply(math.deg)`.
--- - **Note:** Returned rotation is in degrees, not radians.
--- - **Deprecated:** Use `get_bone_override` instead.
---
--- @param bone string
--- @return Position,Position # position and rotation of the bone
function ObjectRef:get_bone_position(bone) end
--- @param object_property_table table<string,any>
function ObjectRef:set_properties(object_property_table) end
--- @return table object property table
function ObjectRef:get_properties() end
--- @return boolean true for players, false otherwise
function ObjectRef:is_player() end
--- Example:
--- ```
--- {
--- text = "",
--- color = {a=0..255, r=0..255, g=0..255, b=0..255},
--- bgcolor = {a=0..255, r=0..255, g=0..255, b=0..255},
--- }
--- ```
--- @return table a table with the attributes of the nametag of an object
function ObjectRef:get_nametag_attributes() end
--- sets the attributes of the nametag of an object.
--- @param attributes table
--- ```
--- {
--- text = "My Nametag",
--- color = ColorSpec,
--- -- ^ Text color
--- bgcolor = ColorSpec or false,
--- -- ^ Sets background color of nametag
--- -- `false` will cause the background to be set automatically based on user settings
--- -- Default: false
--- }
--- ```
function ObjectRef:set_nametag_attributes(attributes) end

View File

@@ -1,71 +0,0 @@
--- @diagnostic disable: missing-return
---@class Entity: ObjectRef
Entity = {}
--- Removes object.
--- * The object is removed after returning from Lua. However the `ObjectRef`
--- itself instantly becomes unusable with all further method calls having
--- no effect and returning `nil`.
function Entity:remove() end
--- @param vel Position e.g. `{x=0.0, y=2.3, z=1.0}` or `vector.new(0.0, 2.3, 1.0)`
function Entity:set_velocity(vel) end
--- @param acc Position e.g. `{x=0.0, y=2.3, z=1.0}` or `vector.new(0.0, 2.3, 1.0)`
function Entity:set_acceleration(acc) end
--- Returns the acceleration, a vector.
--- @return vector
function Entity:get_acceleration() end
--- Remove & readd your objects to force a certain rotation.
--- Does not reset rotation incurred through `automatic_rotate`.
--- @param rot Position (radians). X is pitch (elevation), Y is yaw (heading) and Z is roll (bank).
function Entity:set_rotation(rot) end
--- Returns the rotation, a vector (radians).
--- @return vector
function Entity:get_rotation() end
--- Sets the yaw in radians (heading).
--- @param yaw number
function Entity:set_yaw(yaw) end
--- Returns number in radians.
--- @return number
function Entity:get_yaw() end
--- Set a texture modifier to the base texture, for sprites and meshes.
--- When calling `set_texture_mod` again, the previous one is discarded.
--- @param mod string|TextureModifier the texture modifier. See [Texture modifiers].
function Entity:set_texture_mod(mod) end
--- Returns current texture modifier.
--- @return string|TextureModifier
function Entity:get_texture_mod() end
--- Specifies and starts a sprite animation.
--- Only used by `sprite` and `upright_sprite` visuals.
--- Animations iterate along the frame `y` position.
--- @param start_frame {x:number,y:number} {x=column number, y=row number}, the coordinate of the first frame, default: `{x=0, y=0}`
--- @param num_frames number Total frames in the texture, default: `1`
--- @param framelength number Time per animated frame in seconds, default: `0.2`
--- @param select_x_by_camera boolean Only for visual = `sprite`. Changes the frame `x`position according to the view direction. default: `false`.
--- - First column: subject facing the camera
--- - Second column: subject looking to the left
--- - Third column: subject backing the camera
--- - Fourth column: subject looking to the right
--- - Fifth column: subject viewed from above
--- - Sixth column: subject viewed from below
function Entity:set_sprite(start_frame, num_frames, framelength, select_x_by_camera) end
--- (**Deprecated**: Will be removed in a future version, use the field `self.name` instead)
--- @deprecated
--- @return string
function Entity:get_entity_name() end
--- @generic Lua_Entity: LuaEntity
--- @return Lua_Entity
function Entity:get_luaentity() end

View File

@@ -1,484 +0,0 @@
--- @meta
--- @class Player: ObjectRef
Player = {}
--- @return InvRef
function Player:get_inventory() end
--- returns `""` if is not a player
--- @return string
function Player:get_player_name() end
--- **DEPRECATED**, use get_velocity() instead.
--- table {x, y, z} representing the player's instantaneous velocity in nodes/s
--- @deprecated
function Player:get_player_velocity() end
--- **DEPRECATED**, use add_velocity(vel) instead.
--- @deprecated
function Player:add_player_velocity(vel) end
--- get camera direction as a unit vector
function Player:get_look_dir() end
--- pitch in radians
--- * Angle ranges between -pi/2 and pi/2, which are straight up and down
--- respectively.
function Player:get_look_vertical() end
--- yaw in radians
--- * Angle is counter-clockwise from the +z direction.
--- @return number
function Player:get_look_horizontal() end
--- sets look pitch
--- * radians: Angle from looking forward, where positive is downwards.
function Player:set_look_vertical(radians) end
--- sets look yaw
--- * radians: Angle from the +z direction, where positive is counter-clockwise.
function Player:set_look_horizontal(radians) end
--- pitch in radians - Deprecated as broken. Use
--- `get_look_vertical`.
--- * Angle ranges between -pi/2 and pi/2, which are straight down and up
--- respectively.
function Player:get_look_pitch() end
--- yaw in radians - Deprecated as broken. Use
--- `get_look_horizontal`.
--- * Angle is counter-clockwise from the +x direction.
--- @deprecated
function Player:get_look_yaw() end
--- sets look pitch - Deprecated. Use `set_look_vertical`.
function Player:set_look_pitch(radians) end
--- sets look yaw - Deprecated. Use
--- `set_look_horizontal`.
function Player:set_look_yaw(radians) end
--- returns player's breath
function Player:get_breath() end
--- sets player's breath
--- * values:
--- * `0`: player is drowning
--- * max: bubbles bar is not shown
--- * See [Object properties] for more information
--- * Is limited to range 0 ... 65535 (2^16 - 1)
function Player:set_breath(value) end
--- Sets player's FOV
--- * `fov`: FOV value.
--- * `is_multiplier`: Set to `true` if the FOV value is a multiplier.
--- Defaults to `false`.
--- * `transition_time`: If defined, enables smooth FOV transition.
--- Interpreted as the time (in seconds) to reach target FOV.
--- If set to 0, FOV change is instantaneous. Defaults to 0.
--- * Set `fov` to 0 to clear FOV override.
function Player:set_fov(fov, is_multiplier, transition_time) end
--- Returns the following:
--- * Server-sent FOV value. Returns 0 if an FOV override doesn't exist.
--- * Boolean indicating whether the FOV value is a multiplier.
--- * Time (in seconds) taken for the FOV transition. Set by `set_fov`.
function Player:get_fov() end
--- DEPRECATED, use get_meta() instead
--- * Sets an extra attribute with value on player.
--- * `value` must be a string, or a number which will be converted to a
--- string.
--- * If `value` is `nil`, remove attribute from player.
function Player:set_attribute(attribute, value) end
--- DEPRECATED, use get_meta() instead
--- * Returns value (a string) for extra attribute.
--- * Returns `nil` if no attribute found.
function Player:get_attribute(attribute) end
--- Returns a PlayerMetaRef.
--- @return PlayerMetaRef
function Player:get_meta() end
--- * Redefine player's inventory form
--- * Should usually be called in `on_joinplayer`
--- * If `formspec` is `""`, the player's inventory is disabled.
function Player:set_inventory_formspec(formspec) end
--- returns a formspec string
function Player:get_inventory_formspec() end
--- * the formspec string will be added to every formspec shown to the user,
--- except for those with a no_prepend[] tag.
--- * This should be used to set style elements such as background[] and
--- bgcolor[], any non-style elements (eg: label) may result in weird behavior.
--- * Only affects formspecs shown after this is called.
function Player:set_formspec_prepend(formspec) end
--- returns a formspec string.
function Player:get_formspec_prepend(formspec) end
--- returns table with player pressed keys
--- * The table consists of fields with the following boolean values
--- representing the pressed keys: `up`, `down`, `left`, `right`, `jump`,
--- `aux1`, `sneak`, `dig`, `place`, `LMB`, `RMB`, and `zoom`.
--- * The fields `LMB` and `RMB` are equal to `dig` and `place` respectively,
--- and exist only to preserve backwards compatibility.
--- * Returns an empty table `{}` if the object is not a player.
---
--- @return table<string, boolean>
function Player:get_player_control() end
--- returns integer with bit packed player pressed
--- keys.
--- * Bits:
--- * 0 - up
--- * 1 - down
--- * 2 - left
--- * 3 - right
--- * 4 - jump
--- * 5 - aux1
--- * 6 - sneak
--- * 7 - dig
--- * 8 - place
--- * 9 - zoom
--- * Returns `0` (no bits set) if the object is not a player.
--- @return number
function Player:get_player_control_bits() end
--- @class physics_override_table
--- @field speed? number multiplier to default walking speed value (default: `1`)
--- @field speed_walk? number multiplier to default walk speed value (default: `1`). Note: The actual walk speed is the product of `speed` and `speed_walk`
--- @field speed_climb? number multiplier to default climb speed value (default: `1`). Note: The actual climb speed is the product of `speed` and `speed_climb`
--- @field speed_crouch? number multiplier to default crouch speed value (default: `1`). Note: The actual crouch speed is the product of `speed` and `speed_crouch`
--- @field speed_fast? number multiplier to default fast (sprint) speed value (default: `1`). Note: The actual fast speed is the product of `speed` and `speed_fast`
--- @field jump? number multiplier to default jump value (default: `1`)
--- @field gravity? number multiplier to default gravity value (default: `1`)
--- @field liquid_fluidity? number multiplier to liquid movement resistance value (for nodes with `liquid_move_physics`); the higher this value, the lower the resistance to movement. At math.huge, the resistance is zero and you can move through any liquid like air. (default: `1`). Warning: Values below 1 are currently unsupported.
--- @field liquid_fluidity_smooth? number multiplier to default maximum liquid resistance value (for nodes with `liquid_move_physics`); controls deceleration when entering node at high speed. At higher values you come to a halt more quickly (default: `1`)
--- @field liquid_sink? number multiplier to default liquid sinking speed value; (for nodes with `liquid_move_physics`), (default: `1`)
--- @field acceleration_default? number multiplier to default acceleration value (default: `1`). Note: The actual acceleration is the product of `speed` and `acceleration_default`
--- @field acceleration_air? number multiplier to default air acceleration value (default: `1`). Note: The actual air acceleration is the product of `speed` and `acceleration_air`
--- @field acceleration_fast? number multiplier to default fast (sprint) acceleration (default: `1`). Note: The actual fast acceleration is the product of `speed` and `acceleration_fast`
--- @field sneak? boolean whether player can sneak (default: `true`)
--- @field sneak_glitch? boolean whether player can use the new move code replications of the old sneak side-effects: sneak ladders and 2 node sneak jump (default: `false`)
--- @field new_move? boolean use new move/sneak code. When `false` the exact old code is used for the specific old sneak behavior (default: `true`)
--- set physics override for player
--- * `override_table` is a table with the following fields:
--- * `speed`: multiplier to default walking speed value (default: `1`)
--- * `jump`: multiplier to default jump value (default: `1`)
--- * `gravity`: multiplier to default gravity value (default: `1`)
--- * `sneak`: whether player can sneak (default: `true`)
--- * `sneak_glitch`: whether player can use the new move code replications
--- of the old sneak side-effects: sneak ladders and 2 node sneak jump
--- (default: `false`)
--- * `new_move`: use new move/sneak code. When `false` the exact old code
--- is used for the specific old sneak behavior (default: `true`)
--- @param override_table physics_override_table
function Player:set_physics_override(override_table) end
--- returns the table given to `set_physics_override`
--- @return physics_override_table
function Player:get_physics_override() end
--- add a HUD element described by HUD def, returns ID
--- number on success
function Player:hud_add(hud_definition) end
--- remove the HUD element of the specified id
function Player:hud_remove(id) end
--- change a value of a previously added HUD
--- element.
--- * `stat` supports the same keys as in the hud definition table except for
--- `"hud_elem_type"`.
function Player:hud_change(id, stat, value) end
--- gets the HUD element definition structure of the specified ID
function Player:hud_get(id) end
--- sets specified HUD flags of player.
--- * `flags`: A table with the following fields set to boolean values
--- * `hotbar`
--- * `healthbar`
--- * `crosshair`
--- * `wielditem`
--- * `breathbar`
--- * `minimap`: Modifies the client's permission to view the minimap.
--- The client may locally elect to not view the minimap.
--- * `minimap_radar`: is only usable when `minimap` is true
--- * `basic_debug`: Allow showing basic debug info that might give a gameplay advantage.
--- This includes map seed, player position, look direction, the pointed node and block bounds.
--- Does not affect players with the `debug` privilege.
--- * If a flag equals `nil`, the flag is not modified
function Player:hud_set_flags(flags) end
--- returns a table of player HUD flags with boolean values.
--- * See `hud_set_flags` for a list of flags that can be toggled.
function Player:hud_get_flags() end
--- sets number of items in builtin hotbar
---- * `count`: number of items, must be between `1` and `32`
function Player:hud_set_hotbar_itemcount(count) end
--- returns number of visible items
function Player:hud_get_hotbar_itemcount() end
--- * sets background image for hotbar
function Player:hud_set_hotbar_image(texturename) end
--- returns texturename
function Player:hud_get_hotbar_image() end
--- * sets image for selected item of hotbar
function Player:hud_set_hotbar_selected_image(texturename) end
--- returns texturename
function Player:hud_get_hotbar_selected_image() end
--- modes_list: {mode, mode, ...}
--- * Overrides the available minimap modes (and toggle order), and changes the
--- selected mode.
--- * `mode` is a table consisting of up to four fields:
--- * `type`: Available type:
--- * `off`: Minimap off
--- * `surface`: Minimap in surface mode
--- * `radar`: Minimap in radar mode
--- * `texture`: Texture to be displayed instead of terrain map
--- (texture is centered around 0,0 and can be scaled).
--- Texture size is limited to 512 x 512 pixel.
--- * `label`: Optional label to display on minimap mode toggle
--- The translation must be handled within the mod.
--- * `size`: Sidelength or diameter, in number of nodes, of the terrain
--- displayed in minimap
--- * `texture`: Only for texture type, name of the texture to display
--- * `scale`: Only for texture type, scale of the texture map in nodes per
--- pixel (for example a `scale` of 2 means each pixel represents a 2x2
--- nodes square)
--- * `selected_mode` is the mode index to be selected after modes have been changed
--- (0 is the first mode).
function Player:set_minimap_modes(modes_list, selected_mode) end
--- * The presence of the function `set_sun`, `set_moon` or `set_stars` indicates
--- whether `set_sky` accepts this format. Check the legacy format otherwise.
--- * Passing no arguments resets the sky to its default values.
--- * `sky_parameters` is a table with the following optional fields:
--- * `base_color`: ColorSpec, changes fog in "skybox" and "plain". (default: `#ffffff`)
--- * `body_orbit_tilt`: Float, rotation angle of sun/moon orbit in degrees.
--- By default, orbit is controlled by a client-side setting, and this field is not set.
--- After a value is assigned, it can only be changed to another float value.
--- Valid range [-60.0,60.0] (default: not set)
--- * `type`: Available types:
--- * `"regular"`: Uses 0 textures, `base_color` ignored
--- * `"skybox"`: Uses 6 textures, `base_color` used as fog.
--- * `"plain"`: Uses 0 textures, `base_color` used as both fog and sky.
--- (default: `"regular"`)
--- * `textures`: A table containing up to six textures in the following
--- order: Y+ (top), Y- (bottom), X- (west), X+ (east), Z+ (north), Z- (south).
--- * `clouds`: Boolean for whether clouds appear. (default: `true`)
--- * `sky_color`: A table used in `"regular"` type only, containing the
--- following values (alpha is ignored):
--- * `day_sky`: ColorSpec, for the top half of the sky during the day.
--- (default: `#61b5f5`)
--- * `day_horizon`: ColorSpec, for the bottom half of the sky during the day.
--- (default: `#90d3f6`)
--- * `dawn_sky`: ColorSpec, for the top half of the sky during dawn/sunset.
--- (default: `#b4bafa`)
--- The resulting sky color will be a darkened version of the ColorSpec.
--- Warning: The darkening of the ColorSpec is subject to change.
--- * `dawn_horizon`: ColorSpec, for the bottom half of the sky during dawn/sunset.
--- (default: `#bac1f0`)
--- The resulting sky color will be a darkened version of the ColorSpec.
--- Warning: The darkening of the ColorSpec is subject to change.
--- * `night_sky`: ColorSpec, for the top half of the sky during the night.
--- (default: `#006bff`)
--- The resulting sky color will be a dark version of the ColorSpec.
--- Warning: The darkening of the ColorSpec is subject to change.
--- * `night_horizon`: ColorSpec, for the bottom half of the sky during the night.
--- (default: `#4090ff`)
--- The resulting sky color will be a dark version of the ColorSpec.
--- Warning: The darkening of the ColorSpec is subject to change.
--- * `indoors`: ColorSpec, for when you're either indoors or underground.
--- (default: `#646464`)
--- * `fog_sun_tint`: ColorSpec, changes the fog tinting for the sun
--- at sunrise and sunset. (default: `#f47d1d`)
--- * `fog_moon_tint`: ColorSpec, changes the fog tinting for the moon
--- at sunrise and sunset. (default: `#7f99cc`)
--- * `fog_tint_type`: string, changes which mode the directional fog
--- abides by, `"custom"` uses `sun_tint` and `moon_tint`, while
--- `"default"` uses the classic Minetest sun and moon tinting.
--- Will use tonemaps, if set to `"default"`. (default: `"default"`)
--- * `fog`: A table containing the following values:
--- * `fog_distance`: integer, set an upper bound for the client's viewing_range.
--- Any value >= 0 sets the desired upper bound for viewing_range, disables range_all and prevents disabling fog (F3 key by default).
--- Any value < 0 resets the behavior to being client-controlled. (default: -1)
--- * `fog_start`: float, override the client's fog_start.
--- Fraction of the visible distance at which fog starts to be rendered.
--- Any value between [0.0, 0.99] set the fog_start as a fraction of the viewing_range.
--- Any value < 0, resets the behavior to being client-controlled. (default: -1)
--- * `fog_color`: ColorSpec, override the color of the fog.
--- Unlike `base_color` above this will apply regardless of the skybox type.
--- (default: `"#00000000"`, which means no override)
--- @param sky_parameters table
function Player:set_sky(sky_parameters) end
--- * Deprecated. Use `set_sky(sky_parameters)`
--- * `base_color`: ColorSpec, defaults to white
--- * `type`: Available types:
--- * `"regular"`: Uses 0 textures, `bgcolor` ignored
--- * `"skybox"`: Uses 6 textures, `bgcolor` used
--- * `"plain"`: Uses 0 textures, `bgcolor` used
--- * `clouds`: Boolean for whether clouds appear in front of `"skybox"` or
--- `"plain"` custom skyboxes (default: `true`)
function Player:set_sky(base_color, type, texture_names, clouds) end
--- * `as_table`: boolean that determines whether the deprecated version of this
--- function is being used.
--- * `true` returns a table containing sky parameters as defined in `set_sky(sky_parameters)`.
--- * Deprecated: `false` or `nil` returns base_color, type, table of textures,
--- clouds.
function Player:get_sky(as_table) end
--- * Deprecated: Use `get_sky(as_table)` instead.
--- * returns a table with the `sky_color` parameters as in `set_sky`.
--- @deprecated
function Player:get_sky_color() end
--- * Passing no arguments resets the sun to its default values.
--- * `sun_parameters` is a table with the following optional fields:
--- * `visible`: Boolean for whether the sun is visible.
--- (default: `true`)
--- * `texture`: A regular texture for the sun. Setting to `""`
--- will re-enable the mesh sun. (default: "sun.png", if it exists)
--- The texture appears non-rotated at sunrise and rotated 180 degrees
--- (upside down) at sunset.
--- * `tonemap`: A 512x1 texture containing the tonemap for the sun
--- (default: `"sun_tonemap.png"`)
--- * `sunrise`: A regular texture for the sunrise texture.
--- (default: `"sunrisebg.png"`)
--- * `sunrise_visible`: Boolean for whether the sunrise texture is visible.
--- (default: `true`)
--- * `scale`: Float controlling the overall size of the sun. (default: `1`)
--- Note: For legacy reasons, the sun is bigger than the moon by a factor
--- of about `1.57` for equal `scale` values.
function Player:set_sun(sun_parameters) end
--- returns a table with the current sun parameters as in
--- `set_sun`.
function Player:get_sun() end
--- * Passing no arguments resets the moon to its default values.
--- * `moon_parameters` is a table with the following optional fields:
--- * `visible`: Boolean for whether the moon is visible.
--- (default: `true`)
--- * `texture`: A regular texture for the moon. Setting to `""`
--- will re-enable the mesh moon. (default: `"moon.png"`, if it exists)
--- The texture appears non-rotated at sunrise / moonset and rotated 180
--- degrees (upside down) at sunset / moonrise.
--- Note: Relative to the sun, the moon texture is hence rotated by 180°.
--- You can use the `^[transformR180` texture modifier to achieve the same orientation.
--- * `tonemap`: A 512x1 texture containing the tonemap for the moon
--- (default: `"moon_tonemap.png"`)
--- * `scale`: Float controlling the overall size of the moon (default: `1`)
--- Note: For legacy reasons, the sun is bigger than the moon by a factor
--- of about `1.57` for equal `scale` values.
function Player:set_moon(moon_parameters) end
--- returns a table with the current moon parameters as in
--- `set_moon`.
function Player:get_moon() end
--- * Passing no arguments resets stars to their default values.
--- * `star_parameters` is a table with the following optional fields:
--- * `visible`: Boolean for whether the stars are visible.
--- (default: `true`)
--- * `day_opacity`: Float for maximum opacity of stars at day.
--- No effect if `visible` is false.
--- (default: 0.0; maximum: 1.0; minimum: 0.0)
--- * `count`: Integer number to set the number of stars in
--- the skybox. Only applies to `"skybox"` and `"regular"` sky types.
--- (default: `1000`)
--- * `star_color`: ColorSpec, sets the colors of the stars,
--- alpha channel is used to set overall star brightness.
--- (default: `#ebebff69`)
--- * `scale`: Float controlling the overall size of the stars (default: `1`)
function Player:set_stars(star_parameters) end
--- returns a table with the current stars parameters as in
--- `set_stars`.
function Player:get_stars() end
--- set cloud parameters
--- * Passing no arguments resets clouds to their default values.
--- * `cloud_parameters` is a table with the following optional fields:
--- * `density`: from `0` (no clouds) to `1` (full clouds) (default `0.4`)
--- * `color`: basic cloud color with alpha channel, ColorSpec
--- (default `#fff0f0e5`).
--- * `ambient`: cloud color lower bound, use for a "glow at night" effect.
--- ColorSpec (alpha ignored, default `#000000`)
--- * `height`: cloud height, i.e. y of cloud base (default per conf,
--- usually `120`)
--- * `thickness`: cloud thickness in nodes (default `16`)
--- * `speed`: 2D cloud speed + direction in nodes per second
--- (default `{x=0, z=-2}`).
function Player:set_clouds(cloud_parameters) end
--- returns a table with the current cloud parameters as in
--- `set_clouds`.
function Player:get_clouds() end
--- * `0`...`1`: Overrides day-night ratio, controlling sunlight to a specific
--- amount.
--- * `nil`: Disables override, defaulting to sunlight based on day-night cycle
function Player:override_day_night_ratio(ratio) end
--- returns the ratio or nil if it isn't overridden
function Player:get_day_night_ratio() end
--- set animation for player model in third person view.
--- * Every animation equals to a `{x=starting frame, y=ending frame}` table.
--- * `frame_speed` sets the animations frame speed. Default is 30.
function Player:set_local_animation(idle, walk, dig, walk_while_dig, frame_speed) end
--- returns idle, walk, dig, walk_while_dig tables and
--- `frame_speed`.
function Player:get_local_animation() end
--- defines offset vectors for
--- camera per player. An argument defaults to `{x=0, y=0, z=0}` if unspecified.
--- * in first person view
--- * in third person view (max. values `{x=-10/10,y=-10,15,z=-5/5}`)
--- v -- [firstperson, thirdperson]
function Player:set_eye_offset(v) end
--- returns first and third person offsets.
function Player:get_eye_offset() end
--- * Sends an already loaded mapblock to the player.
--- * Returns `false` if nothing was sent (note that this can also mean that
--- the client already has the block)
--- * Resource intensive - use sparsely
function Player:send_mapblock(blockpos) end
--- sets lighting for the player
--- * `light_definition` is a table with the following optional fields:
--- * `saturation` sets the saturation (vividness).
--- values > 1 increase the saturation
--- values in [0,1) decrease the saturation
--- * This value has no effect on clients who have the "Tone Mapping" shader disabled.
--- * `shadows` is a table that controls ambient shadows
--- * `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness)
--- * This value has no effect on clients who have the "Dynamic Shadows" shader disabled.
function Player:set_lighting(light_definition) end
--- returns the current state of lighting for the player.
--- * Result is a table with the same fields as `light_definition` in `set_lighting`.
function Player:get_lighting() end
--- Respawns the player using the same mechanism as the death screen,
--- including calling on_respawnplayer callbacks.
function Player:respawn() end

View File

@@ -1,82 +0,0 @@
--- @diagnostic disable: missing-return
--- 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
--- 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
--- 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.
---
--- ### Format
---
--- The settings have the format `key = value`. Example:
--- ```
--- foo = example text
--- bar = """
--- Multiline
--- value
--- """
--- ```
--- @class Settings
Settings = {}
--- Returns a value of setting `key`
--- Returns `nil` if `key` is not found.
--- @param key string
--- @return string|nil
function Settings:get(key) end
--- returns a boolean
--- * `default` is the value returned if `key` is not found.
--- * Returns `nil` if `key` is not found and `default` not specified.
--- @overload fun(key:string):boolean|nil
--- @param key string
--- @return boolean|nil
function Settings:get_bool(key, default) end
--- returns a NoiseParams table
--- @param key string
function Settings:get_np_group(key) end
--- * Returns `{flag = true/false, ...}` according to the set flags.
--- * Is currently limited to mapgen flags `mg_flags` and mapgen-specific flags like `mgv5_spflags`.
--- @param key string
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`).
--- @param key string
--- @param value string
function Settings:set(key, value) end
--- * See documentation for set() above.
--- @param key string
--- @param value boolean
function Settings:set_bool(key, value) end
--- * `value` is a NoiseParams table.
--- * Also, see documentation for set() above.
--- @param key string
--- @param value table
function Settings:set_np_group(key, value) end
--- Returns a boolean (`true` for success)
--- @param key string
--- @return boolean
function Settings:remove(key) end
--- returns `{key1,...}`
--- @return table
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`.
--- @param key string
--- @return boolean
function Settings:has(key) end
--- returns a boolean (`true` for success)
--- * Writes changes to file.
--- @return boolean
function Settings:write() end
--- returns `{[key1]=value1,...}`
--- @return table<string,string>
function Settings:to_table() end

View File

@@ -1,24 +0,0 @@
--- @diagnostic disable: missing-return
--- A value noise generator. It can be created via ValueNoise() or core.get_value_noise().
--- For core.get_value_noise(), the actual seed used is the noiseparams seed plus the world
--- seed, to create world-specific noise.
---
--- **Important**: These require the mapgen environment to be initalized, do not use at load time.
---
--- * `ValueNoise(noiseparams)`
--- * `ValueNoise(seed, octaves, persistence, spread)` (deprecated)
--- * `core.get_value_noise(noiseparams)`
--- * `core.get_value_noise(seeddiff, octaves, persistence, spread)` (deprecated)
--- @class ValueNoise
ValueNoise = {}
--- Returns 2D noise value at `pos={x=,y=}`
--- @param pos Position2d
--- @return number
function ValueNoise:get_2d(pos) end
--- Returns 3D noise value at `pos={x=,y=,z=}`
--- @param pos Position
--- @return number
function ValueNoise:get_3d(pos) end

View File

@@ -1,77 +0,0 @@
--- @diagnostic disable: missing-return
--- A fast, bulk noise generator.
---
--- It can be created via `ValueNoiseMap(noiseparams, size)` or
--- `core.get_value_noise_map(noiseparams, size)`.
--- For `core.get_value_noise_map()`, the actual seed used is the noiseparams seed
--- plus the world seed, to create world-specific noise.
---
--- Format of `size` is `{x=dimx, y=dimy, z=dimz}`. The `z` component is omitted
--- for 2D noise, and it must be larger than 1 for 3D noise (otherwise
--- `nil` is returned).
---
--- For each of the functions with an optional `buffer` parameter:If `buffer` is not nil, this
--- table will be used to store the result instead of creating a new table.
---
--- **Important**: These require the mapgen environment to be initalized, do not use at load time.
--- @class ValueNoiseMap
ValueNoiseMap = {}
--- Returns a `<size.x>` times `<size.y>` 2D array of 2D noise
--- with values starting at `pos={x=,y=}`
--- @param pos Position2d
--- @return table
function ValueNoiseMap:get_2d_map(pos) end
--- Returns a `<size.x>` times `<size.y>` times `<size.z>`
--- 3D array of 3D noise with values starting at `pos={x=,y=,z=}`
--- @param pos Position
--- @return table
function ValueNoiseMap:get_3d_map(pos) end
--- Returns a flat `<size.x * size.y>` element
--- array of 2D noise with values starting at `pos={x=,y=}`
--- @param pos Position2d
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
--- @return table
function ValueNoiseMap:get_2d_map_flat(pos, buffer) end
--- Same as `get2dMap_flat`, but 3D noise
--- @param pos Position
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
--- @return table
function ValueNoiseMap:get_3d_map_flat(pos, buffer) end
--- Calculates the 2d noise map starting at `pos`. The result
--- is stored internally.
--- @param pos Position2d
function ValueNoiseMap:calc_2d_map(pos) end
--- Calculates the 3d noise map starting at `pos`. The result
--- is stored internally.
--- @param pos Position
function ValueNoiseMap:calc_3d_map(pos) end
--- In the form of an array,
--- returns a slice of the most recently computed noise results. The result slice
--- begins at coordinates `slice_offset` and takes a chunk of `slice_size`.
--- E.g., to grab a 2-slice high horizontal 2d plane of noise starting at buffer
--- offset `y = 20`:
--- ```lua
--- noisevals = noise:get_map_slice({y=20}, {y=2})
--- ```
--- It is important to note that `slice_offset` offset coordinates begin at 1,
--- and are relative to the starting position of the most recently calculated
--- noise.
--- To grab a single vertical column of noise starting at map coordinates
--- `x = 1023, y=1000, z = 1000`:
--- ```lua
--- noise:calc_3d_map({x=1000, y=1000, z=1000})
--- noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})
--- ```
--- @param slice_offset {x:number?,y:number?,z:number?}
--- @param slice_size {x:number?,y:number?,z:number?}
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
--- @return table
function ValueNoiseMap:get_map_slice(slice_offset, slice_size, buffer) end

View File

@@ -1,73 +0,0 @@
--- @diagnostic disable: missing-return
--- @class VoxelArea
--- A helper class for voxel areas.
--- It can be created via `VoxelArea(pmin, pmax)` or
--- `VoxelArea:new({MinEdge = pmin, MaxEdge = pmax})`.
--- The coordinates are *inclusive*, like most other things in Minetest.
VoxelArea = {}
--- The coordinates are *inclusive*, like most other things in Minetest.
---
--- Also you can create an instance via `VoxelArea(pmin, pmax)`
---
--- @param cuboid { MinEdge: any, MaxEdge: any }
--- @return VoxelArea
function VoxelArea:new(cuboid) end
--- returns a 3D vector containing the size of the area formed by `MinEdge` and `MaxEdge`.
--- @return Position
function VoxelArea:getExtent() end
--- returns the volume of the area formed by `MinEdge` and `MaxEdge`.
--- @return number
function VoxelArea:getVolume() end
--- returns the index of an absolute position in a flat array starting at `1`.
--- * `x`, `y` and `z` must be integers to avoid an incorrect index result.
--- * The position (x, y, z) is not checked for being inside the area volume,
--- being outside can cause an incorrect index result.
--- * Useful for things like `VoxelManip`, raw Schematic specifiers,
--- `PerlinNoiseMap:get2d`/`3dMap`, and so on.
--- @param x number
--- @param y number
--- @param z number
--- @return number
function VoxelArea:index(x, y, z) end
--- same functionality as `index(x, y, z)` but takes a vector.
--- * As with `index(x, y, z)`, the components of `p` must be integers, and `p`
--- is not checked for being inside the area volume.
--- @param position Position
--- @return number
function VoxelArea:indexp(position) end
--- returns the absolute position vector corresponding to index `i`.
--- @param i number
--- @return Position
function VoxelArea:position(i) end
--- check if (`x`,`y`,`z`) is inside area formed by `MinEdge` and `MaxEdge`.
--- @param x number
--- @param y number
--- @param z number
--- @return boolean
function VoxelArea:contains(x, y, z) end
--- check if Position(`x`,`y`,`z`) is inside area formed by `MinEdge` and `MaxEdge`.
--- @param position Position
--- @return boolean
function VoxelArea:containsp(position) end
--- same as above, except takes an index `i`
function VoxelArea:containsi(i) end
--- returns an iterator that returns indices.
--- * from (`min_x`,`min_y`,`min_z`) to (`max_x`,`max_y`,`max_z`) in the order of `[z [y [x]]]`.
--- @param min_x number
--- @param min_y number
--- @param min_z number
--- @param max_x number
--- @param max_y number
--- @param max_z number
--- @return fun(tbl: table<number, number>): number, number
function VoxelArea:iter(min_x, min_y, min_z, max_x, max_y, max_z) end
--- returns an iterator that returns indices.
--- * from (`min_x`,`min_y`,`min_z`) to (`max_x`,`max_y`,`max_z`) in the order of `[z [y [x]]]`.
--- @param min_pos Position
--- @param max_pos Position
--- @return fun(tbl: table<number, number>): number, number
function VoxelArea:iterp(min_pos, max_pos) end

View File

@@ -1,108 +0,0 @@
--- @diagnostic disable: missing-return
--- @class VoxelManip
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.7.0/doc/lua_api.txt#L4244)
VoxelManip = {}
--- Loads a chunk of map into the VoxelManip object
--- containing the region formed by `p1` and `p2`.
--- * returns actual emerged `pmin`, actual emerged `pmax`
--- @param position1 Position min position for load part of map
--- @param position2 Position max position for load part of map
--- @return Position, Position
function VoxelManip:read_from_map(position1, position2) end
--- Writes the data loaded from the `VoxelManip` back to
--- the map.
--- * **important**: data must be set using `VoxelManip:set_data()` before
--- calling this.
--- * 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.
--- 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
--- Returns a `MapNode` table of the node currently loaded in
--- the `VoxelManip` at that position
function VoxelManip:get_node_at(pos) end
--- Sets a specific `MapNode` in the `VoxelManip` at
--- that position.
function VoxelManip:set_node_at(pos, node) end
--- Retrieves the node content data loaded into the `VoxelManip` object.
--- * returns raw node data in the form of an array of node content IDs
--- * if the param `buffer` is present, this table will be used to store the
--- result instead.
--- @param buffer number[]|nil
--- @return number[]
function VoxelManip:get_data(buffer) end
--- Sets the data contents of the `VoxelManip` object
--- * expects raw node data in the form of an array of node content IDs
--- * the array must be exactly the size of the volume of the `VoxelManip` object
--- * the array must be indexed from `1` to `volume`
--- * the data can be retrieved using `VoxelManip:get_data()`
--- @param data number[]
function VoxelManip:set_data(data) end
--- Sets the data contents of the `VoxelManip` object
--- function VoxelManip:set_data(data) end
--- Does nothing, kept for compatibility.
--- 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`.
--- * (`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
--- Gets the light data read into the `VoxelManip` object.
--- * Returns an array (indices 1 to volume) of integers ranging from `0` to
--- `255`.
--- * Each value is the bitwise combination of day and night light values
--- (`0` to `15` each).
--- * `light = day + (night * 16)`
--- * If the param `buffer` is present, this table will be used to store the
--- result instead.
--- @param buffer number[]? [optional]
--- @return number[]
function VoxelManip:get_light_data(buffer) end
--- Sets the `param1` (light) contents of each node in the `VoxelManip`.
--- * expects lighting data in the same format that `get_light_data()` returns
--- @param light_data number[]
function VoxelManip:set_light_data(light_data) end
--- Gets the raw `param2` data read into the `VoxelManip` object.
--- * Returns an array (indices 1 to volume) of integers ranging from `0` to
--- `255`.
--- * If the param `buffer` is present, this table will be used to store the
--- result instead.
--- @param buffer number[]? [optional]
--- @return number[]
function VoxelManip:get_param2_data(buffer) end
--- Sets the `param2` contents of each node in the `VoxelManip`.
--- @param param2_data number[]
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`.
--- * (`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.
--- * `propagate_shadow` is an optional boolean deciding whether shadows in a
--- generated mapchunk above are propagated down into the mapchunk, defaults
--- to `true` if left out.
--- @overload fun(p1:Position, p2:Position)
--- @overload fun(propagate_shadow:boolean)
--- @overload fun()
--- @param p1 Position
--- @param p2 Position
--- @param propagate_shadow boolean
function VoxelManip:calc_lighting(p1, p2, propagate_shadow) end
--- Update liquid flow
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.
function VoxelManip:was_modified() end
--- Returns actual emerged minimum and maximum positions.
function VoxelManip:get_emerged_area() end

View File

@@ -1,215 +0,0 @@
--- @diagnostic disable: missing-return
--- @class vector: Position
--- @operator eq : boolean
--- @operator unm : vector
--- @operator add(vector): vector
--- @operator sub(vector): vector
--- @operator mul(number): vector
--- @operator div(number): vector
vector = {}
--- Creates a new vector `(a, b, c)`.
--- * Deprecated: `vector.new()` does the same as `vector.zero()` and
--- `vector.new(v)` does the same as `vector.copy(v)`
--- @param x number|Position
--- @param y? number
--- @param z? number
--- @return vector
function vector.new(x, y, z) end
--- Returns a new vector (0, 0, 0).
--- @return vector
function vector.zero() end
--- Returns a new vector of length 1, pointing into a direction chosen uniformly at random.
--- @return vector
function vector.random_direction() end
--- Returns a copy of the vector.
--- @return vector
function vector:copy() end
--- Returns `v, np`, where `v` is a vector read from the given string `s` and
--- `np` is the next position in the string after the vector.
--- Returns `nil` on failure.
--- `str`: Has to begin with a substring of the form `"(x, y, z)"`. Additional
--- spaces, leaving away commas and adding an additional comma to the end
--- is allowed.
--- `from_position`: If given starts looking for the vector at this string index.
---
--- @param str string
--- @param from_position? integer # If given starts looking for the vector at this string index
--- @return vector?, integer
function vector.from_string(str, from_position) end
--- Returns a string of the form `"(x, y, z)"`.
--- `tostring(v)` does the same.
--- @return string
function vector:to_string() end
--- Returns a string of the form `"(x, y, z)"`.
--- @deprecated Use `vector:to_string()` instead.
--- @return string
function vector:tostring() end
--- Returns a vector of length 1 with direction `p1` to `p2`.
--- If `p1` and `p2` are identical, returns `(0, 0, 0)`.
--- @param p1 Position
--- @param p2 Position
--- @return vector
function vector.direction(p1, p2) end
--- Returns the distance between `p1` and `p2`.
--- @param p1 Position
--- @param p2 Position
--- @return number # Returns zero or a positive number, the distance between `p1` and `p2`.
function vector.distance(p1, p2) end
--- Returns the length of the vector.
--- @return number # Returns zero or a positive number, the length of the vector.
function vector:length() end
--- - Returns a normalized copy of the vector.
--- *(Returns a vector of length 1 with direction of vector).*
--- - If vector has zero length, returns (0, 0, 0).
--- @return vector
function vector:normalize() end
--- Returns a vector, each dimension rounded down.
--- @return vector
function vector:floor() end
--- Returns a vector, each dimension rounded up.
--- @return vector
function vector:ceil() end
--- Returns a vector, each dimension rounded to the nearest integer.
--- At a multiple of 0.5, rounds away from zero.
--- @return vector
function vector:round() end
--- Returns a vector where `math.sign` was called for each component.
--- See [Helper functions](https://api.luanti.org/helper-functions/) for details.
function vector:sign() end
--- Returns a vector with absolute values for each component.
function vector:abs() end
--- Applies a function to each component of the vector and returns a new vector.
--- Additional arguments are passed to the function.
--- @param func fun(number, ...): number # Function to apply. First argument is the component value.
--- @param ... any # Additional arguments passed to `func`.
--- @return vector # New vector with modified components.
function vector:apply(func, ...) end
--- Returns a vector where the function func has combined both components of v and w for each component.
--- @param v2 vector # Second vector to combine with.
--- @param func fun(number, number): number
--- @return vector # New vector with combined components.
function vector:combine(v2, func) end
--- Returns a boolean, true if the vectors are identical.
--- @param other vector
--- @return boolean
function vector:equals(other) end
--- Returns in order minp, maxp vectors of the cuboid defined by `v1`, `v2`.
--- @param v1 vector
--- @param v2 vector
--- @return vector minp, vector maxp
function vector.sort(v1, v2) end
--- Returns the angle between vectors in radians.
--- @param other vector
function vector:angle(other) end
--- Calculates the dot product (скалярное произведение) with another vector.
--- @param other vector
--- @return number
function vector:dot(other) end
--- Calculates the cross product (векторное произведение) with another vector.
--- @param other vector
--- @return vector
function vector:cross(other) end
--- Returns a new vector with the offset applied.
--- *(Returns the sum of the vector and v(x, y, z).)*
--- @param x number
--- @param y number
--- @param z number
--- @return vector
function vector:offset(x, y, z) end
--- - Returns a boolean value indicating whether the vector is a real vector, eg. created by a `vector.*` function.
--- - Returns `false` for anything else, including tables like `{ x = 3, y = 1, z = 4 }`.
--- @return boolean
function vector:check() end
--- Returns a boolean value indicating if `pos` is inside area formed by `min` and `max`.
--- - `min` and `max` are inclusive.
--- - If `min` is bigger than `max` on some axis, function always returns `false`.
--- - You can use `vector.sort` if you have two vectors and don't know which are the minimum and the maximum.
--- @param pos Position
--- @param min Position
--- @param max Position
--- @return boolean
function vector.in_area(pos, min, max) end
--- Returns a random integer position in area formed by `min` and `max`.
--- - `min` and `max` are inclusive.
--- - You can use `vector.sort` if you have two vectors and don't know which are the minimum and the maximum.
--- @param min Position
--- @param max Position
--- @return vector
function vector.random_in_area(min, max) end
--- Returns a vector.
--- - If `x` is a vector: Returns the sum of the vector and `x`.
--- - If `x` is a number: Adds `x` to each component of the vector.
--- @param x vector|number
--- @return vector
function vector:add(x) end
--- Returns a vector.
--- - If `x` is a vector: Returns the difference of the vector and `x`.
--- - If `x` is a number: Subtracts `x` from each component of the vector.
--- @param x vector|number
--- @return vector
function vector:subtract(x) end
--- Returns a scaled vector.
--- - Deprecated: If `scalar` is a vector: Returns the Schur product.
--- @param self vector
--- @param scalar number|vector
--- @return vector
function vector.multiply(self, scalar) end
--- Returns a scaled vector.
--- - Deprecated: If `scalar` is a vector: Returns the Schur quotient.
--- @param scalar number
--- @return vector
function vector:divide(scalar) end
--- Applies the rotation `rotation` to the vector and returns the result vector.
--- - Uses (extrinsic) Z-X-Y rotation order and is right-handed, consistent with `ObjectRef:set_rotation`.
--- - `vector.rotate(vector.new(0, 0, 1), rotation)` and `vector.rotate(vector.new(0, 1, 0), rotation)`
--- return vectors pointing forward and up relative to an entity's rotation `rotation`.
--- @param rotation vector
--- @return vector
function vector:rotate(rotation) end
--- Rotates the vector around `axis` by `angle` radians according to the right hand rule
--- and returns the result vector.
--- @param axis vector
--- @param angle number # Angle in radians
--- @return vector
function vector:rotate_around_axis(axis, angle) end
--- Returns a rotation vector for `direction` pointing forward using `up` as the up vector.
--- - If `up` is omitted, the roll of the returned vector defaults to zero.
--- - Otherwise `direction` and `up` need to be vectors in a 90 degree angle to each other.
--- @param direction vector
--- @param up? vector
--- @return vector
function vector.dir_to_rotation(direction, up) end