aboutsummaryrefslogtreecommitdiff
path: root/builtin/common/item_s.lua
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-10-18 18:01:44 -0400
committerGitHub <noreply@github.com>2022-10-18 18:01:44 -0400
commitb38ffdec279bcded98e34f5116c8d676aa9f73a7 (patch)
tree31cafdb009b2f81b61a96286a3800a8e408f8f3d /builtin/common/item_s.lua
parent23e9f5db4330a6efee5270160a3959422926ce77 (diff)
downloadminetest-b38ffdec279bcded98e34f5116c8d676aa9f73a7.tar.xz
Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'builtin/common/item_s.lua')
-rw-r--r--builtin/common/item_s.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/builtin/common/item_s.lua b/builtin/common/item_s.lua
index 6e4269b7d..f848ef6d8 100644
--- a/builtin/common/item_s.lua
+++ b/builtin/common/item_s.lua
@@ -223,3 +223,17 @@ function builtin_shared.cache_content_ids()
end
end
end
+
+if core.set_read_node and core.set_push_node then
+ local function read_node(node)
+ return name2content[node.name], node.param1, node.param2
+ end
+ core.set_read_node(read_node)
+ core.set_read_node = nil
+
+ local function push_node(content, param1, param2)
+ return {name = content2name[content], param1 = param1, param2 = param2}
+ end
+ core.set_push_node(push_node)
+ core.set_push_node = nil
+end