forked from mtcontrib/chesttools
allow players who can access the chest to dig it
This commit is contained in:
parent
d1093fe448
commit
6d2bfe336a
7
init.lua
7
init.lua
@ -469,10 +469,11 @@ minetest.register_node( 'chesttools:shared_chest', {
|
||||
"listring[current_player;main]")
|
||||
end,
|
||||
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
can_dig = function(pos, player)
|
||||
local player_name = (player and player.get_player_name and player:get_player_name()) or ""
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and player:get_player_name() == meta:get_string('owner');
|
||||
return player_name and inv:is_empty("main") and not minetest.is_protected(pos, player_name)
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
|
Loading…
Reference in New Issue
Block a user