From 3a248a56d3bac97a285def6e3e16b7c6b1118131 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 9 Apr 2012 12:36:25 +0300 Subject: [PATCH] Improve doc/lua_api.txt and add minetest.get_item_group(name, group) --- builtin/misc.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/builtin/misc.lua b/builtin/misc.lua index 23baca1..89f90df 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -55,11 +55,15 @@ 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 +function minetest.get_item_group(name, group) + if not minetest.registered_items[name] or not + minetest.registered_items[name].groups[group] then return 0 end - return minetest.registered_nodes[name].groups[group] + return minetest.registered_items[name].groups[group] +end + +function minetest.get_node_group(name, group) + return minetest.get_item_group(name, group) end