From: Lejo Date: Mon, 6 Jan 2020 21:16:33 +0000 (+0100) Subject: Make can_interact_with_node() check for key group instead of default:key X-Git-Tag: 5.2.0~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=beb0aefa2dd07a236741bb9a2d30a8b12943c868;p=oweals%2Fminetest_game.git Make can_interact_with_node() check for key group instead of default:key --- 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