aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/misc.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/misc.lua b/builtin/misc.lua
index 01d5d1d4d..23baca1c8 100644
--- a/builtin/misc.lua
+++ b/builtin/misc.lua
@@ -55,4 +55,11 @@ function minetest.hash_node_position(pos)
return (pos.z+32768)*65536*65536 + (pos.y+32768)*65536 + pos.x+32768
end
+function minetest.get_node_group(name, group)
+ if not minetest.registered_nodes[name] or not
+ minetest.registered_nodes[name].groups[group] then
+ return 0
+ end
+ return minetest.registered_nodes[name].groups[group]
+end