From b3a6063dc1f7a7cf7611c9363ac592e7307f66d6 Mon Sep 17 00:00:00 2001 From: jp Date: Fri, 27 Nov 2015 01:20:19 +0100 Subject: [PATCH] Inform player when mailbox is full --- mailbox.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mailbox.lua b/mailbox.lua index c0196e4..b23c416 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -58,12 +58,14 @@ xdecor.register("mailbox", { meta:set_string("stack1", stack_name) 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 local meta = minetest.get_meta(pos) local inv = meta:get_inventory() if inv:room_for_item("mailbox", stack) then return -1 end end + minetest.chat_send_player(player_name, "The mailbox is full.") return 0 end }) -- 2.44.0