mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make core.get_node_raw
a public API (#16265)
Co-authored-by: Erich Schubert <erich.schubert@tu-dortmund.de>
This commit is contained in:
parent
0794145b64
commit
8eceabd812
3 changed files with 125 additions and 12 deletions
|
@ -740,16 +740,16 @@ core.noneitemdef_default = { -- This is used for the hand and unknown items
|
|||
--
|
||||
|
||||
local get_node_raw = core.get_node_raw
|
||||
core.get_node_raw = nil
|
||||
local get_name_from_content_id = core.get_name_from_content_id
|
||||
|
||||
function core.get_node(pos)
|
||||
local content, param1, param2 = get_node_raw(pos.x, pos.y, pos.z)
|
||||
return {name = core.get_name_from_content_id(content), param1 = param1, param2 = param2}
|
||||
return {name = get_name_from_content_id(content), param1 = param1, param2 = param2}
|
||||
end
|
||||
|
||||
function core.get_node_or_nil(pos)
|
||||
local content, param1, param2, pos_ok = get_node_raw(pos.x, pos.y, pos.z)
|
||||
return pos_ok and
|
||||
{name = core.get_name_from_content_id(content), param1 = param1, param2 = param2}
|
||||
{name = get_name_from_content_id(content), param1 = param1, param2 = param2}
|
||||
or nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue