From c2f74cd42a5d1977767578250248630fb95de391 Mon Sep 17 00:00:00 2001 From: 163140 <163140@autistici.org> Date: Mon, 8 Dec 2014 01:31:06 +0000 Subject: [PATCH] Added signal "empty" "Empty" signal useful for automated factories --- digilines_inventory/init.lua | 4 ++++ 1 file changed, 4 insertions(+) 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