Add item name to chest log messages
authorrubenwardy <rubenwardy@gmail.com>
Sat, 2 Jan 2016 12:04:31 +0000 (12:04 +0000)
committerparamat <mat.gregory@virginmedia.com>
Wed, 24 Feb 2016 22:53:20 +0000 (22:53 +0000)
mods/default/nodes.lua

index 1e39be99de633c6aa3d51bacfef50420b3c85671..3b70c2b4a68d7ca8d51d031f401808e2c2de460a 100644 (file)
@@ -1445,11 +1445,13 @@ minetest.register_node("default:chest", {
        end,
     on_metadata_inventory_put = function(pos, listname, index, stack, player)
                minetest.log("action", player:get_player_name() ..
-                       " moves stuff to chest at " .. minetest.pos_to_string(pos))
+                       " moves " .. stack:get_name() ..
+                       " to chest at " .. minetest.pos_to_string(pos))
        end,
     on_metadata_inventory_take = function(pos, listname, index, stack, player)
                minetest.log("action", player:get_player_name() ..
-                       " takes stuff from chest at " .. minetest.pos_to_string(pos))
+                       " takes " .. stack:get_name() ..
+                       " from chest at " .. minetest.pos_to_string(pos))
        end,
 })
 
@@ -1505,11 +1507,13 @@ minetest.register_node("default:chest_locked", {
        end,
     on_metadata_inventory_put = function(pos, listname, index, stack, player)
                minetest.log("action", player:get_player_name() ..
-                       " moves stuff to locked chest at " .. minetest.pos_to_string(pos))
+                       " moves " .. stack:get_name() ..
+                       " to locked chest at " .. minetest.pos_to_string(pos))
        end,
     on_metadata_inventory_take = function(pos, listname, index, stack, player)
                minetest.log("action", player:get_player_name() ..
-                       " takes stuff from locked chest at " .. minetest.pos_to_string(pos))
+                       " takes " .. stack:get_name()  ..
+                       " from locked chest at " .. minetest.pos_to_string(pos))
        end,
        on_rightclick = function(pos, node, clicker)
                local meta = minetest.get_meta(pos)