1 local S
= minetest
.get_translator("mcl_tt")
4 tt
.register_snippet(function(itemstring
)
5 local def
= minetest
.registered_items
[itemstring
]
7 local head
= minetest
.get_item_group(itemstring
, "armor_head")
8 local torso
= minetest
.get_item_group(itemstring
, "armor_torso")
9 local legs
= minetest
.get_item_group(itemstring
, "armor_legs")
10 local feet
= minetest
.get_item_group(itemstring
, "armor_feet")
12 s
= s
.. S("Head armor")
15 s
= s
.. S("Torso armor")
18 s
= s
.. S("Legs armor")
21 s
= s
.. S("Feet armor")
28 tt
.register_snippet(function(itemstring
)
29 local def
= minetest
.registered_items
[itemstring
]
31 local use
= minetest
.get_item_group(itemstring
, "mcl_armor_uses")
32 local pts
= minetest
.get_item_group(itemstring
, "mcl_armor_points")
34 s
= s
.. S("Armor points: @1", pts
)
38 s
= s
.. S("Armor durability: @1", use
)
46 tt
.register_snippet(function(itemstring
)
47 local armor_g
= minetest
.get_item_group(itemstring
, "horse_armor")
48 if armor_g
and armor_g
> 0 then
49 return S("Protection: @1%", 100 - armor_g
)
53 tt
.register_snippet(function(itemstring
)
54 local def
= minetest
.registered_items
[itemstring
]
56 if def
.groups
.eatable
and def
.groups
.eatable
> 0 then
57 s
= s
.. S("Hunger points: +@1", def
.groups
.eatable
)
59 if def
._mcl_saturation
and def
._mcl_saturation
> 0 then
63 s
= s
.. S("Saturation points: +@1", string.format("%.1f", def
._mcl_saturation
))
71 tt
.register_snippet(function(itemstring
)
72 local def
= minetest
.registered_items
[itemstring
]
73 if minetest
.get_item_group(itemstring
, "crush_after_fall") == 1 then
74 return S("Deals damage when falling"), "#FFFF00"
78 tt
.register_snippet(function(itemstring
)
79 local def
= minetest
.registered_items
[itemstring
]
80 if def
.groups
.place_flowerlike
== 1 then
81 return S("Grows on grass blocks or dirt")
82 elseif def
.groups
.place_flowerlike
== 2 then
83 return S("Grows on grass blocks, podzol, dirt or coarse dirt")
87 tt
.register_snippet(function(itemstring
)
88 local def
= minetest
.registered_items
[itemstring
]
89 if def
.groups
.flammable
then
94 tt
.register_snippet(function(itemstring
)
95 if itemstring
== "mcl_heads:zombie" then
96 return S("Zombie view range: -50%")
97 elseif itemstring
== "mcl_heads:skeleton" then
98 return S("Skeleton view range: -50%")
99 elseif itemstring
== "mcl_heads:creeper" then
100 return S("Creeper view range: -50%")