1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-07-03 23:20:22 +02:00

add default.log_action function

This commit is contained in:
nixnoxus
2022-03-30 23:57:08 +02:00
parent 659895c3ed
commit 876a2f7cef
4 changed files with 19 additions and 22 deletions

View File

@ -224,18 +224,13 @@ function default.chest.register_chest(prefixed_name, d)
def.on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in chest at " .. minetest.pos_to_string(pos))
default.log_action(player, pos, "moves stuff in chest")
end
def.on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves " .. stack:get_name() ..
" to chest at " .. minetest.pos_to_string(pos))
default.log_action(player, pos, "moves " .. stack:get_name() .. " to chest")
end
def.on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes " .. stack:get_name() ..
" from chest at " .. minetest.pos_to_string(pos))
default.log_action(player, pos, "takes " .. stack:get_name() .. " from chest")
end
local def_opened = table.copy(def)