1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

Merge branch 'master' into 'master'

Display item's description in infotext.

See merge request VanessaE/homedecor_modpack!14
This commit is contained in:
Vanessa Dannenberg 2020-10-12 08:27:09 +00:00
commit f2cd1fbd49

View File

@ -153,6 +153,12 @@ minetest.register_node("itemframes:frame",{
drop_item(pos,node) drop_item(pos,node)
local s = itemstack:take_item() local s = itemstack:take_item()
meta:set_string("item",s:to_string()) meta:set_string("item",s:to_string())
local description = ""
local item_meta = s:get_meta()
if item_meta then
description = item_meta:get_string("description") or ""
end
meta:set_string("infotext", S("Item frame (owned by @1)\n@2", name, description))
update_item(pos,node) update_item(pos,node)
end end
return itemstack return itemstack
@ -163,6 +169,7 @@ minetest.register_node("itemframes:frame",{
if name == meta:get_string("owner") or if name == meta:get_string("owner") or
minetest.check_player_privs(name, "protection_bypass") then minetest.check_player_privs(name, "protection_bypass") then
drop_item(pos, node) drop_item(pos, node)
meta:set_string("infotext", S("Item frame (owned by @1)", name))
end end
end, end,
can_dig = function(pos,player) can_dig = function(pos,player)
@ -216,6 +223,12 @@ minetest.register_node("itemframes:pedestal",{
drop_item(pos,node) drop_item(pos,node)
local s = itemstack:take_item() local s = itemstack:take_item()
meta:set_string("item",s:to_string()) meta:set_string("item",s:to_string())
local description = ""
local item_meta = s:get_meta()
if item_meta then
description = item_meta:get_string("description") or ""
end
meta:set_string("infotext", S("Pedestal (owned by @1)\n@2", name, description))
update_item(pos,node) update_item(pos,node)
end end
return itemstack return itemstack
@ -226,6 +239,7 @@ minetest.register_node("itemframes:pedestal",{
if name == meta:get_string("owner") or if name == meta:get_string("owner") or
minetest.check_player_privs(name, "protection_bypass") then minetest.check_player_privs(name, "protection_bypass") then
drop_item(pos,node) drop_item(pos,node)
meta:set_string("infotext", S("Pedestal (owned by @1)", name))
end end
end, end,
can_dig = function(pos,player) can_dig = function(pos,player)