From 4bf0c760d4b46805ebdddf91697209c2bf993fa0 Mon Sep 17 00:00:00 2001 From: ssdaniel24 Date: Mon, 23 Dec 2024 16:53:18 +0300 Subject: [PATCH] Book desc will be added on every book use --- mods/lord/Blocks/lord_mail/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/lord/Blocks/lord_mail/init.lua b/mods/lord/Blocks/lord_mail/init.lua index afc84ccb6..d0cb33f89 100644 --- a/mods/lord/Blocks/lord_mail/init.lua +++ b/mods/lord/Blocks/lord_mail/init.lua @@ -195,12 +195,15 @@ minetest.register_craftitem("lord_mail:paper_with_text", { -- books + local function book_on_use(itemstack, user, pointed_thing) local player_name = user:get_player_name() - local data = minetest.deserialize(itemstack:get_metadata()) + local meta = itemstack:get_metadata() + local data = minetest.deserialize(meta) local title, text, owner = "", "", player_name if data then title, text, owner = data.title, data.text, data.owner + meta:set_string("description", SL('Book')..': '..colorize('#ee8' , '"'.. title ..'"')) end local formspec = '' .. spec.size(8, 8.5)