summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Euchner <norrepli@gmail.com>2014-12-08 12:38:20 +0100
committerFlorian Euchner <norrepli@gmail.com>2014-12-08 12:38:20 +0100
commita121bc0b12074dbcd0a42f81022cae9f44811f1a (patch)
tree404d006c622119e162d6b234ca10f783c97a8e45
parent241a7ed75fa2fdaae776d83919bcb84ffef10ca8 (diff)
parentc2f74cd42a5d1977767578250248630fb95de391 (diff)
Merge pull request #20 from 163140/master
Added signal "empty"
-rw-r--r--digilines_inventory/init.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/digilines_inventory/init.lua b/digilines_inventory/init.lua
index e44359a..72275ea 100644
--- a/digilines_inventory/init.lua
+++ b/digilines_inventory/init.lua
@@ -127,6 +127,10 @@ minetest.register_node("digilines_inventory:chest", {
minetest.log("action", player:get_player_name().." puts stuff into chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ local inv = minetest.get_meta(pos):get_inventory()
+ if inv:is_empty(listname) then
+ sendMessage(pos, "empty", channel)
+ end
sendMessage(pos,"utake "..maybeString(stack))
minetest.log("action", player:get_player_name().." takes stuff from chest at "..minetest.pos_to_string(pos))
end