From 35a0b9e9f658fd775177796a411e73f9f21995ba Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Wed, 17 Jul 2024 08:22:04 +0800 Subject: [PATCH 1/2] Log player dropping items --- builtin/game/item.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/game/item.lua b/builtin/game/item.lua index 8b79d2d71..895b70e0c 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -376,6 +376,9 @@ function core.item_drop(itemstack, dropper, pos) dir.z = dir.z * 2.9 obj:set_velocity(dir) obj:get_luaentity().dropped_by = dropper:get_player_name() + + core.log("action", dropper:get_player_name() .. " dropped " .. + item:to_string() .. " at " .. core.pos_to_string(p, 1)) end return itemstack end From e9e0cfcfd37ab39c24bfe9295ec6cb46ec82f4eb Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Wed, 31 Jul 2024 16:11:01 +0800 Subject: [PATCH 2/2] Omit metadata --- builtin/game/item.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/game/item.lua b/builtin/game/item.lua index 895b70e0c..6d99d1198 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -377,8 +377,10 @@ function core.item_drop(itemstack, dropper, pos) obj:set_velocity(dir) obj:get_luaentity().dropped_by = dropper:get_player_name() - core.log("action", dropper:get_player_name() .. " dropped " .. - item:to_string() .. " at " .. core.pos_to_string(p, 1)) + core.log("action", string.format("%s dropped %s %i at %s", + dropper_is_player and dropper:get_player_name() or "A mod", + item:get_name(), item:get_count(), + core.pos_to_string(p, 1))) end return itemstack end