Extracting Addon for LLS.

This commit is contained in:
Alexander Chibrikin
2025-10-26 20:40:07 +03:00
parent de74607136
commit 7a707a4562
44 changed files with 0 additions and 4 deletions

70
classes/MetaDataRef.lua Normal file
View File

@@ -0,0 +1,70 @@
--- @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