mirror of
https://github.com/Sokomine/chesttools.git
synced 2025-01-09 17:40:37 +01:00
commit
054b9e62a2
9
init.lua
9
init.lua
@ -90,7 +90,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
chesttools.may_use = function( pos, player )
|
chesttools.may_use = function( pos, player )
|
||||||
if( not( player )) then
|
if not (pos and player and player.is_player and player:is_player() and not player.is_fake_player) then
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
local name = player:get_player_name();
|
local name = player:get_player_name();
|
||||||
@ -469,10 +469,11 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||||||
"listring[current_player;main]")
|
"listring[current_player;main]")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos, player)
|
||||||
local meta = minetest.get_meta(pos);
|
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()
|
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,
|
end,
|
||||||
|
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||||
|
Loading…
Reference in New Issue
Block a user