MineClone2/mods/CORE/mcl_enchanting/tt.lua

16 lines
465 B
Lua
Raw Normal View History

function mcl_enchanting.enchantments_snippet(_, _, itemstack)
if not itemstack then
return
end
local enchantments = mcl_enchanting.get_enchantments(itemstack)
local text = ""
for enchantment, level in pairs(enchantments) do
2020-11-01 13:44:05 +01:00
text = text .. mcl_enchanting.get_colorized_enchantment_description(enchantment, level) .. "\n"
end
if text ~= "" then
return text, false
end
end
table.insert(tt.registered_snippets, 1, mcl_enchanting.enchantments_snippet)