Add logs for books

This commit is contained in:
Peppy 2019-12-07 09:26:47 +01:00
parent 7b927e6f94
commit e007ec3e86

View File

@ -87,6 +87,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.save and fields.title and fields.text
and fields.title ~= "" and fields.text ~= "" then
minetest.log("action", string.format("%s has written in a book (title: \"%s\"): \"%s\" at location %s",
player:get_player_name(), fields.title, fields.text, minetest.pos_to_string(player:getpos())))
local new_stack, data
if stack:get_name() ~= "default:book_written" then
local count = stack:get_count()