Mailbox : prevent digging if inv ain't empty
This commit is contained in:
parent
c55a027aef
commit
76da7309d2
@ -34,7 +34,8 @@ xdecor.register("mailbox", {
|
|||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local inv = meta:get_inventory()
|
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,
|
end,
|
||||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user