Mailbox : prevent digging if inv ain't empty

This commit is contained in:
jp 2015-08-06 20:22:44 +02:00
parent c55a027aef
commit 76da7309d2

View File

@ -34,7 +34,8 @@ xdecor.register("mailbox", {
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
return player:get_player_name() == owner and inv:is_empty("main")
if not inv:is_empty("main") then return false end
return player:get_player_name() == owner
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)