From b3aed9d6b829547f74a466c73438f98176c2c533 Mon Sep 17 00:00:00 2001 From: kabou Date: Sun, 20 Feb 2022 18:06:04 +0100 Subject: [PATCH] Use proper get_item_group accessor. Instead of directly accessing the group table in node definitions, use the proper minetest.get_item_group accessor to test for "cauldron" group. Also adds local alias get_item_group for the global minetest call. --- mods/ITEMS/mcl_buckets/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 1d37f2e0d..3bbae5487 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -24,7 +24,7 @@ local add_node = minetest.add_node local add_item = minetest.add_item local registered_nodes = minetest.registered_nodes - +local get_item_group = minetest.get_item_group if mod_mcl_core then minetest.register_craft({ @@ -167,8 +167,8 @@ local function on_place_bucket(itemstack, user, pointed_thing, def) local abovenode = get_node(pointed_thing.above) local name1, name2 = undernode.name, abovenode.name local regnode1, regnode2 = registered_nodes[name1], registered_nodes[name2] - local buildable1 = regnode1 and (regnode1.buildable_to or regnode1.groups.cauldron == 1) - local buildable2 = regnode2 and (regnode2.buildable_to or regnode2.groups.cauldron == 1) + local buildable1 = regnode1 and (regnode1.buildable_to or get_item_group(name1, "cauldron") == 1) + local buildable2 = regnode2 and (regnode2.buildable_to or get_item_group(name2, "cauldron") == 1) if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip