mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 22:22:25 +01:00
Make can_interact_with_node() check for key group instead of default:key
This commit is contained in:
parent
1940961d63
commit
beb0aefa2d
@ -148,7 +148,6 @@ end)
|
|||||||
minetest.register_craftitem("default:skeleton_key", {
|
minetest.register_craftitem("default:skeleton_key", {
|
||||||
description = S("Skeleton Key"),
|
description = S("Skeleton Key"),
|
||||||
inventory_image = "default_key_skeleton.png",
|
inventory_image = "default_key_skeleton.png",
|
||||||
groups = {key = 1},
|
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
return itemstack
|
return itemstack
|
||||||
|
@ -639,7 +639,7 @@ function default.can_interact_with_node(player, pos)
|
|||||||
|
|
||||||
-- Is player wielding the right key?
|
-- Is player wielding the right key?
|
||||||
local item = player:get_wielded_item()
|
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()
|
local key_meta = item:get_meta()
|
||||||
|
|
||||||
if key_meta:get_string("secret") == "" then
|
if key_meta:get_string("secret") == "" then
|
||||||
|
Loading…
Reference in New Issue
Block a user