From beb0aefa2dd07a236741bb9a2d30a8b12943c868 Mon Sep 17 00:00:00 2001 From: Lejo Date: Mon, 6 Jan 2020 22:16:33 +0100 Subject: [PATCH] Make can_interact_with_node() check for key group instead of default:key --- mods/default/craftitems.lua | 1 - mods/default/functions.lua | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index 045f745a..923d754f 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -148,7 +148,6 @@ end) minetest.register_craftitem("default:skeleton_key", { description = S("Skeleton Key"), inventory_image = "default_key_skeleton.png", - groups = {key = 1}, on_use = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return itemstack diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 450984d0..18ba561b 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -639,7 +639,7 @@ function default.can_interact_with_node(player, pos) -- Is player wielding the right key? local item = player:get_wielded_item() - if item:get_name() == "default:key" then + if minetest.get_item_group(item:get_name(), "key") == 1 then local key_meta = item:get_meta() if key_meta:get_string("secret") == "" then -- 2.25.1