1
0
Fork 0
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:
sfan5 2025-06-25 15:05:22 +02:00 committed by GitHub
parent 0794145b64
commit 8eceabd812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 125 additions and 12 deletions

View file

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