Skip to content

Commit

Permalink
Book desc will be added on every book use
Browse files Browse the repository at this point in the history
  • Loading branch information
ssdaniel24 authored and alek13 committed Dec 23, 2024
1 parent ded38fb commit 4bf0c76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mods/lord/Blocks/lord_mail/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4bf0c76

Please sign in to comment.