mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-23 07:10:19 +01:00
Show the contents of the locked chest only to the owner
This commit is contained in:
parent
c1b1f2aa49
commit
a0ba7cf973
@ -1281,10 +1281,6 @@ minetest.register_node("default:chest_locked", {
|
|||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec",
|
|
||||||
"size[8,9]"..
|
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
|
||||||
"list[current_player;main;0,5;8,4;]")
|
|
||||||
meta:set_string("infotext", "Locked Chest")
|
meta:set_string("infotext", "Locked Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -1340,6 +1336,16 @@ minetest.register_node("default:chest_locked", {
|
|||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
|
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
if has_locked_chest_privilege(meta, clicker) then
|
||||||
|
local pos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||||
|
minetest.show_formspec(clicker:get_player_name(),
|
||||||
|
"size[8,9]"..
|
||||||
|
"list[nodemeta:".. pos .. ";main;0,0;8,4;]"..
|
||||||
|
"list[current_player;main;0,5;8,4;]")
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
default.furnace_inactive_formspec =
|
default.furnace_inactive_formspec =
|
||||||
|
Loading…
Reference in New Issue
Block a user