Inform player when mailbox is full
This commit is contained in:
parent
c9e137c64b
commit
b3a6063dc1
@ -58,12 +58,14 @@ xdecor.register("mailbox", {
|
|||||||
meta:set_string("stack1", stack_name)
|
meta:set_string("stack1", stack_name)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, _, stack, _)
|
allow_metadata_inventory_put = function(pos, listname, _, stack, player)
|
||||||
|
local player_name = player:get_player_name()
|
||||||
if listname == "drop" then
|
if listname == "drop" then
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if inv:room_for_item("mailbox", stack) then return -1 end
|
if inv:room_for_item("mailbox", stack) then return -1 end
|
||||||
end
|
end
|
||||||
|
minetest.chat_send_player(player_name, "The mailbox is full.")
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user