Skip to content

Commit

Permalink
Make can_interact_with_node() check for key group instead of default:key
Browse files Browse the repository at this point in the history
  • Loading branch information
Lejo1 authored and paramat committed Jan 6, 2020
1 parent 1940961 commit beb0aef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion mods/default/craftitems.lua
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mods/default/functions.lua
Expand Up @@ -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
Expand Down

0 comments on commit beb0aef

Please sign in to comment.