mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-05 07:13:52 +01:00
Extend inventory action logging to include bones (#3040)
This commit is contained in:
parent
16bf166902
commit
d86435d86c
@ -28,7 +28,7 @@ local bones_formspec =
|
||||
local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or 1200
|
||||
local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
|
||||
|
||||
minetest.register_node("bones:bones", {
|
||||
local bones_def = {
|
||||
description = S("Bones"),
|
||||
tiles = {
|
||||
"bones_top.png^[transform2",
|
||||
@ -130,7 +130,11 @@ minetest.register_node("bones:bones", {
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
end,
|
||||
})
|
||||
}
|
||||
|
||||
default.set_inventory_action_loggers(bones_def, "bones")
|
||||
|
||||
minetest.register_node("bones:bones", bones_def)
|
||||
|
||||
local function may_replace(pos, player)
|
||||
local node_name = minetest.get_node(pos).name
|
||||
|
@ -754,12 +754,12 @@ function default.set_inventory_action_loggers(def, name)
|
||||
end
|
||||
local on_put = def.on_metadata_inventory_put or nop
|
||||
def.on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
default.log_player_action(player, "moves", stack:get_name(), "to", name, "at", pos)
|
||||
default.log_player_action(player, "moves", stack:get_name(), stack:get_count(), "to", name, "at", pos)
|
||||
return on_put(pos, listname, index, stack, player)
|
||||
end
|
||||
local on_take = def.on_metadata_inventory_take or nop
|
||||
def.on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
default.log_player_action(player, "takes", stack:get_name(), "from", name, "at", pos)
|
||||
default.log_player_action(player, "takes", stack:get_name(), stack:get_count(), "from", name, "at", pos)
|
||||
return on_take(pos, listname, index, stack, player)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user