diff --git a/builtin/game/item.lua b/builtin/game/item.lua index 4d68f1136..4f6962e5e 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -739,16 +739,13 @@ core.noneitemdef_default = { -- This is used for the hand and unknown items -- get_node implementation -- -local get_node_raw = core.get_node_raw -core.get_node_raw = nil - function core.get_node(pos) - local content, param1, param2 = get_node_raw(pos.x, pos.y, pos.z) + local content, param1, param2 = core.get_node_raw(pos.x, pos.y, pos.z) return {name = core.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) + local content, param1, param2, pos_ok = core.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} or nil diff --git a/doc/lua_api.md b/doc/lua_api.md index ca3a5fee7..7e38e36ee 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -6481,6 +6481,11 @@ Environment access * `core.get_node_or_nil(pos)` * Same as `get_node` but returns `nil` for unloaded areas. * Note that even loaded areas can contain "ignore" nodes. +* `core.get_node_raw(x, y, z)` + * Low-level API returning numbers, not tables + * Returns `content_id`, `param1`, `param2`, and `pos_ok` + * The `content_id` can be mapped to a node name via `core.get_name_from_content_id` + * If `pos_ok` is false, the node is not yet loaded and the `content_id` is that of "ignore" nodes * `core.get_node_light(pos[, timeofday])` * Gets the light value at the given position. Note that the light value "inside" the node at the given position is returned, so you usually want