1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-30 22:00: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

@ -717,8 +717,8 @@ end
--
-- NOTICE: This method is not an official part of the API yet.
-- This method may change in future.
-- NOTICE: This methods are not an official part of the API yet.
-- This methods may change in future.
--
function default.can_interact_with_node(player, pos)
@ -757,3 +757,11 @@ function default.can_interact_with_node(player, pos)
return false
end
function default.log_action(player, pos, message)
-- only log actions of real players
if player and not player.is_fake_player and player:is_player() then
minetest.log("action", player:get_player_name() ..
" " .. message .. " at " .. minetest.pos_to_string(pos))
end
end