forked from mtcontrib/chesttools
merged flux' PRs
This commit is contained in:
commit
7d32cb06c7
9
init.lua
9
init.lua
@ -95,7 +95,7 @@ end
|
||||
|
||||
|
||||
chesttools.may_use = function( pos, player )
|
||||
if( not( player ) or not(pos) or not(pos.x)) then
|
||||
if not (pos and player and player.is_player and player:is_player() and not player.is_fake_player) then
|
||||
return false;
|
||||
end
|
||||
local name = player:get_player_name();
|
||||
@ -497,10 +497,11 @@ chesttools.register_chest = function(node_name, desc, name, paramtype2, palette,
|
||||
"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 and player:is_player() 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