Improved tool tooltips (#4306)
Co-authored-by: Araca <araca.prod@gmail.com> Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4306
This commit is contained in:
parent
bbc20d5f06
commit
48e6ffa935
@ -534,6 +534,7 @@ end
|
||||
function mcl_util.use_item_durability(itemstack, n)
|
||||
local uses = mcl_util.calculate_durability(itemstack)
|
||||
itemstack:add_wear(65535 / uses * n)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
|
||||
function mcl_util.deal_damage(target, damage, mcl_reason)
|
||||
|
@ -448,6 +448,7 @@ function minetest.node_dig(pos, node, digger)
|
||||
end
|
||||
end
|
||||
end
|
||||
tt.reload_itemstack_description(wielded) -- update tooltip
|
||||
digger:set_wielded_item(wielded)
|
||||
end
|
||||
|
||||
|
@ -646,6 +646,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
||||
if def.tool_capabilities and def.tool_capabilities.punch_attack_uses then
|
||||
local wear = math.floor(65535/tool_capabilities.punch_attack_uses)
|
||||
weapon:add_wear(wear)
|
||||
tt.reload_itemstack_description(weapon) -- update tooltip
|
||||
hitter:set_wielded_item(weapon)
|
||||
end
|
||||
end, hitter:get_player_name())
|
||||
|
@ -122,6 +122,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
|
||||
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
item:add_wear(mobs_mc.shears_wear)
|
||||
tt.reload_itemstack_description(item) -- update tooltip
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
-- Use bucket to milk
|
||||
|
@ -249,6 +249,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
|
||||
})
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
item:add_wear(mobs_mc.shears_wear)
|
||||
tt.reload_itemstack_description(item) -- update tooltip
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
return
|
||||
|
@ -131,6 +131,7 @@ mcl_mobs.register_mob("mobs_mc:snowman", {
|
||||
-- Wear out
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
item:add_wear(mobs_mc.shears_wear)
|
||||
tt.reload_itemstack_description(item) -- update tooltip
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
end
|
||||
|
@ -255,7 +255,7 @@ local function factoid_toolcaps(tool_capabilities, check_uses)
|
||||
formstring = formstring .. miningtimesstr
|
||||
end
|
||||
if useslines > 0 then
|
||||
formstring = formstring .. S("Mining durability:") .. "\n"
|
||||
formstring = formstring .. S("Durability:") .. "\n"
|
||||
formstring = formstring .. miningusesstr
|
||||
end
|
||||
if caplines > 0 or useslines > 0 or timelines > 0 then
|
||||
|
@ -134,7 +134,7 @@ Unknown item (@1)=Unbekannter Gegenstand (@1)
|
||||
Itemstring: "@1"=Itemstring: „@1“
|
||||
Durability: @1 uses=Haltbarkeit: @1 Benutzungen
|
||||
Durability: @1=Haltbarkeit: @1
|
||||
Mining durability:=Grabehaltbarkeit:
|
||||
Durability:=Haltbarkeit:
|
||||
• @1, level @2: @3 uses=• @1, Stufe @2: @3 Benutzungen
|
||||
• @1, level @2: Unlimited=• @1, Stufe @2: Unbegrenzt
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Die Rotation dieses Blocks hängt davon ab, wie sie ihn platzieren: Platzieren Sie ihn auf den Boden oder an die Decke, um ihn vertikal aufzustellen; platzieren Sie in an der Seite für eine horizontale Ausrichtung. Wenn Sie während des Bauens schleichen, wird der Block stattdessen senkrecht zur üblichen Ausrichtung rotiert.
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=ukendt genstand (@1)
|
||||
Itemstring: "@1"=Genstandsstreng: "@1"
|
||||
Durability: @1 uses=Holdbarhed: @1 anvendelser
|
||||
Durability: @1=Holdbarhed: @1
|
||||
Mining durability:=Udvindingsholdbarhed:
|
||||
Durability:=Holdbarhed:
|
||||
• @1, level @2: @3 uses=• @1, level @2: @3 anvendelser
|
||||
• @1, level @2: Unlimited=• @1, level @2: Uendelig
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Denne bloks rotation påvirkes af måden du placerer den på: Placér den på gulvet eller loftet for en lodret orientering; placér den på siden for en horisontal orientering. Hvis du sniger dig mens den placeres den vinkelret i stedet.
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=Objet inconnu (@1)
|
||||
Itemstring: "@1"=Identifiant d'objet : "@1"
|
||||
Durability: @1 uses=Durabilité : @1 utilisations
|
||||
Durability: @1=Durabilité : @1
|
||||
Mining durability:=Durabilité de minage :
|
||||
Durability:=Durabilité :
|
||||
• @1, level @2: @3 uses=• @1, niveau @2 : @3 utilisations
|
||||
• @1, level @2: Unlimited=• @1, niveau @2 : Illimité
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=La manière dont vous placez ce bloc affecte sa rotation : placez-le au sol ou au plafond pour une orientation verticale ; placez-le sur un coté pour une orientation horizontale. Pour le placer de manière perpendiculaire, utilisez la touche déplacement discrêt en le plaçant.
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=不明なアイテム (@1)
|
||||
Itemstring: "@1"=アイテム文字列:"@1"
|
||||
Durability: @1 uses=耐久度:@1回 使用
|
||||
Durability: @1=耐久度:@1
|
||||
Mining durability:=採掘耐久度:
|
||||
Durability:=耐久度:
|
||||
• @1, level @2: @3 uses=・@1, レベル @2:@3回 使用
|
||||
• @1, level @2: Unlimited=・@1, レベル @2:無限
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=このブロックの回転は、置き方に影響されます:床や天井に置くと垂直方向、横に置くと水平方向になります。スニークしながら置くと、代わって直角の方向に向きます。
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=Nieznany przedmiot (@1)
|
||||
Itemstring: "@1"=Id przedmiotu: "@1"
|
||||
Durability: @1 uses=Wytrzymałość: @1 użyć
|
||||
Durability: @1=Wytrzymałość: @1
|
||||
Mining durability:=Wytrzymałość kopania:
|
||||
Durability:=Wytrzymałość:
|
||||
• @1, level @2: @3 uses=• @1, poziom @2: @3 użyć
|
||||
• @1, level @2: Unlimited=• @1, poziom @2: Nielimitowane
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Na rotację tego bloku wpływa sposób postawienia: Postaw go na podłodze lub suficie aby uzyskać pionową orientację; postaw go na boku by uzyskać poziomą orientację. Skradanie się podczas postawiania sprawia, że zostanie postawiony prostopadle.
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=Item desconhecido (@1)
|
||||
Itemstring: "@1"=
|
||||
Durability: @1 uses=
|
||||
Durability: @1=
|
||||
Mining durability:=
|
||||
Durability:=
|
||||
• @1, level @2: @3 uses=
|
||||
• @1, level @2: Unlimited=
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=Item desconhecido (@1)
|
||||
Itemstring: "@1"=
|
||||
Durability: @1 uses=Durabilidade: @1 usos
|
||||
Durability: @1=Durabilidade: @1
|
||||
Mining durability:=
|
||||
Durability:=Durabilidade:
|
||||
• @1, level @2: @3 uses=
|
||||
• @1, level @2: Unlimited=
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=Неизвестный предмет (@1)
|
||||
Itemstring: "@1"=Техническое название: "@1"
|
||||
Durability: @1 uses=Прочность: @1 использований
|
||||
Durability: @1=Прочность: @1
|
||||
Mining durability:=Прочность при добыче:
|
||||
Durability:=Прочность:
|
||||
• @1, level @2: @3 uses=• @1, уровень @2: @3 раз(а)
|
||||
• @1, level @2: Unlimited=• @1, уровень @2: Неограниченно
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Поворот этого блока зависит от того как вы его ставите: поставьте его на пол или потолок для вертикальной ориентации; поместите на стену для горизонтальной ориентации. Удерживайте [Красться] при размещении для перпендикулярной ориентации.
|
||||
|
@ -135,7 +135,7 @@ Unknown item (@1)=
|
||||
Itemstring: "@1"=
|
||||
Durability: @1 uses=
|
||||
Durability: @1=
|
||||
Mining durability:=
|
||||
Durability:=
|
||||
• @1, level @2: @3 uses=
|
||||
• @1, level @2: Unlimited=
|
||||
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=
|
||||
|
@ -374,7 +374,7 @@ doc.sub.items.register_factoid("tools", "misc", function(itemstring, def)
|
||||
capstr = capstr .. S("Mining speed: @1", speedstr) .. "\n"
|
||||
end
|
||||
if miningusesstr ~= "" then
|
||||
capstr = capstr .. S("Mining durability: @1", miningusesstr) .. "\n"
|
||||
capstr = capstr .. S("Durability: @1", miningusesstr) .. "\n"
|
||||
end
|
||||
|
||||
-- Only show one group at max
|
||||
|
@ -70,7 +70,7 @@ Instantaneous=Unmittelbar
|
||||
@1 uses=@1 Verwendungen
|
||||
Unlimited uses=Unbegrenzte Verwendungen
|
||||
Block breaking strength: @1=Blockbruchstärke: @1
|
||||
Mining durability: @1=Grabehaltbarkeit: @1
|
||||
Durability: @1=Haltbarkeit: @1
|
||||
Armor points: @1=Rüstungspunkte: @1
|
||||
Armor durability: @1=Rüstungshaltbarkeit: @1
|
||||
It can be worn on the head.=Es kann auf dem Kopf getragen werden.
|
||||
|
@ -70,7 +70,7 @@ Instantaneous=Momentan
|
||||
@1 uses=@1 anvendelser
|
||||
Unlimited uses=Uendelige anvendelser
|
||||
Block breaking strength: @1=Blokkens brudstyrke: @1
|
||||
Mining durability: @1=Udvindingsholdbarhed: @1
|
||||
Durability: @1=Holdbarhed: @1
|
||||
Armor points: @1=Rustningspoint: @1
|
||||
Armor durability: @1=Rustningens holdbarhed: @1
|
||||
It can be worn on the head.=Den kan bæres på hovedet.
|
||||
|
@ -71,7 +71,7 @@ Instantaneous=Instantané
|
||||
@1 uses=@1 utilisations
|
||||
Unlimited uses=Utilisations illimitées
|
||||
Block breaking strength: @1=Résistance de rupture de bloc : @1
|
||||
Mining durability: @1=Durabilité de minage : @1
|
||||
Durability: @1=Durabilité : @1
|
||||
Armor points: @1=Point d'armure : @1
|
||||
Armor durability: @1=Durabilité de l'armure : @1
|
||||
It can be worn on the head.=Il peut être porté sur la tête.
|
||||
|
@ -70,7 +70,7 @@ Instantaneous=瞬間的
|
||||
@1 uses=@1 使用
|
||||
Unlimited uses=無限に使用可能
|
||||
Block breaking strength: @1=ブロック破壊力:@1
|
||||
Mining durability: @1=採掘耐久度:@1
|
||||
Durability: @1=耐久性:@1
|
||||
Armor points: @1=防具値:@1
|
||||
Armor durability: @1=防具耐久度:@1
|
||||
It can be worn on the head.=頭に装着することもできます。
|
||||
|
@ -70,7 +70,7 @@ Instantaneous=Natychmiastowe
|
||||
@1 uses=@1 użyć
|
||||
Unlimited uses=Nielimitowane użycia
|
||||
Block breaking strength: @1=Siła niszczenia bloku: @1
|
||||
Mining durability: @1=Wytrzymałość kopania: @1
|
||||
Durability: @1=Wytrzymałość: @1
|
||||
Armor points: @1=Punkty zbroi: @1
|
||||
Armor durability: @1=Wytrzymałość zbroi: @1
|
||||
It can be worn on the head.=Może być noszony na głowie.
|
||||
|
@ -70,7 +70,7 @@ Instantaneous=мгновенно
|
||||
@1 uses=@1
|
||||
Unlimited uses=не ограничено
|
||||
Block breaking strength: @1=Сила добычи: @1
|
||||
Mining durability: @1=Прочность при добыче: @1
|
||||
Durability: @1=Прочность: @1
|
||||
Armor points: @1=Очки брони: @1
|
||||
Armor durability: @1=Прочность брони: @1
|
||||
It can be worn on the head.=Это можно носить на голове.
|
||||
|
@ -71,7 +71,7 @@ Instantaneous=
|
||||
@1 uses=
|
||||
Unlimited uses=
|
||||
Block breaking strength: @1=
|
||||
Mining durability: @1=
|
||||
Durability: @1=
|
||||
Armor points: @1=
|
||||
Armor durability: @1=
|
||||
It can be worn on the head.=
|
||||
|
@ -41,7 +41,6 @@ Fast=Schnell
|
||||
Slow=Langsam
|
||||
Very slow=Sehr langsam
|
||||
Painfully slow=Furchtbar langsam
|
||||
Mining durability: @1=Grabehaltbarkeit: @1
|
||||
Block breaking strength: @1=Blockbruchstärke: @1
|
||||
@1 uses=@1 Verwendungen
|
||||
Unlimited uses=Unbegrenzte Verwendungen
|
||||
|
@ -41,7 +41,6 @@ Fast=Rápido
|
||||
Slow=Lento
|
||||
Very slow=Muy lento
|
||||
Painfully slow=Dolorosamente lento
|
||||
Mining durability: @1=Durabilidad de minería: @1
|
||||
Block breaking strength: @1=Fuerza para romper bloques: @1
|
||||
@1 uses=@1 usos
|
||||
Unlimited uses=Usos ilimitados
|
||||
|
@ -41,7 +41,6 @@ Fast=Rapide
|
||||
Slow=Lent
|
||||
Very slow=Très lent
|
||||
Painfully slow=Péniblement lent
|
||||
Mining durability: @1=Durabilité de minage : @1
|
||||
Block breaking strength: @1=Résistance à la rupture : @1
|
||||
@1 uses=@1 utilisations
|
||||
Unlimited uses=Utilisations illimitées
|
||||
|
@ -41,7 +41,6 @@ Fast=速い
|
||||
Slow=遅い
|
||||
Very slow=とても遅い
|
||||
Painfully slow=苦痛レベルで遅い
|
||||
Mining durability: @1=採掘耐久度:@1
|
||||
Block breaking strength: @1=ブロック破壊力:@1
|
||||
@1 uses=@1 使用
|
||||
Unlimited uses=無限に使用可能
|
||||
|
@ -41,7 +41,7 @@ Fast=Szybkie
|
||||
Slow=Wolne
|
||||
Very slow=Bardzo wolne
|
||||
Painfully slow=Boleśnie wolne
|
||||
Mining durability: @1=Wytrzymałość kopania: @1
|
||||
Durability: @1=Wytrzymałość: @1
|
||||
Block breaking strength: @1=Siła niszczenia bloku: @1
|
||||
@1 uses=@1 użyć
|
||||
Unlimited uses=Nielimitowane użycia
|
||||
|
@ -41,7 +41,6 @@ Fast=Rápido
|
||||
Slow=Lento
|
||||
Very slow=Muito lento
|
||||
Painfully slow=Dolorosamente lento
|
||||
Mining durability: @1=Durabilidade de mineração: @1
|
||||
Block breaking strength: @1=Força de quebra do bloco: @1
|
||||
@1 uses=@1 usos
|
||||
Unlimited uses=Usos ilimitados
|
||||
|
@ -42,7 +42,6 @@ Fast=Высокая
|
||||
Slow=Низкая
|
||||
Very slow=Очень низкая
|
||||
Painfully slow=Крайне низкая
|
||||
Mining durability: @1=Прочность при добыче: @1
|
||||
Block breaking strength: @1=Сила добычи: @1
|
||||
@1 uses=@1
|
||||
Unlimited uses=не ограничено
|
||||
|
@ -41,7 +41,6 @@ Fast=
|
||||
Slow=
|
||||
Very slow=
|
||||
Painfully slow=
|
||||
Mining durability: @1=
|
||||
Block breaking strength: @1=
|
||||
@1 uses=
|
||||
Unlimited uses=
|
||||
|
@ -35,7 +35,7 @@ local function newline(str)
|
||||
end
|
||||
|
||||
-- Digging capabilities of tool
|
||||
tt.register_snippet(function(itemstring, toolcaps)
|
||||
tt.register_snippet(function(itemstring, toolcaps, itemstack)
|
||||
local def = minetest.registered_items[itemstring]
|
||||
if not toolcaps then
|
||||
return
|
||||
@ -85,7 +85,12 @@ tt.register_snippet(function(itemstring, toolcaps)
|
||||
if def._doc_items_durability == nil and base_uses > 0 then
|
||||
local real_uses = base_uses * math.pow(3, maxlevel)
|
||||
if real_uses < 65535 then
|
||||
miningusesstr = S("@1 uses", real_uses)
|
||||
if itemstack then
|
||||
local remaining_uses = math.round(real_uses - (itemstack:get_wear() * base_uses) / 65535)
|
||||
miningusesstr = remaining_uses .. "/" .. real_uses
|
||||
else
|
||||
miningusesstr = S("@1 uses", real_uses)
|
||||
end
|
||||
else
|
||||
miningusesstr = S("Unlimited uses")
|
||||
end
|
||||
@ -95,7 +100,7 @@ tt.register_snippet(function(itemstring, toolcaps)
|
||||
capstr = capstr .. S("Mining speed: @1", speedstr) .. "\n"
|
||||
end
|
||||
if miningusesstr ~= "" then
|
||||
capstr = capstr .. S("Mining durability: @1", miningusesstr) .. "\n"
|
||||
capstr = capstr .. S("Durability: @1", miningusesstr) .. "\n"
|
||||
end
|
||||
|
||||
-- Only show one group at max
|
||||
|
@ -25,6 +25,7 @@ tt.register_snippet(function(itemstring)
|
||||
end
|
||||
return s
|
||||
end)
|
||||
|
||||
tt.register_snippet(function(itemstring, _, itemstack)
|
||||
--local def = minetest.registered_items[itemstring]
|
||||
local s = ""
|
||||
@ -34,13 +35,18 @@ tt.register_snippet(function(itemstring, _, itemstack)
|
||||
s = s .. S("Armor points: @1", pts)
|
||||
s = s .. "\n"
|
||||
end
|
||||
local remaining_uses = use
|
||||
if itemstack then
|
||||
local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking")
|
||||
if unbreaking > 0 then
|
||||
use = math.floor(use / (0.6 + 0.4 / (unbreaking + 1)))
|
||||
end
|
||||
remaining_uses = math.round(use - (itemstack:get_wear() * use) / 65535)
|
||||
end
|
||||
if use > 0 then
|
||||
if use ~= remaining_uses then
|
||||
use = remaining_uses .. "/" .. use -- implicit conversion from number to string
|
||||
end
|
||||
s = s .. S("Armor durability: @1", use)
|
||||
end
|
||||
if s == "" then
|
||||
@ -109,6 +115,9 @@ end)
|
||||
|
||||
tt.register_snippet(function(itemstring, _, itemstack)
|
||||
if itemstring:sub(1, 23) == "mcl_fishing:fishing_rod" or itemstring:sub(1, 12) == "mcl_bows:bow" then
|
||||
return S("Durability: @1", S("@1 uses", mcl_util.calculate_durability(itemstack or ItemStack(itemstring))))
|
||||
local stack = itemstack or ItemStack(itemstring)
|
||||
local use = mcl_util.calculate_durability(stack)
|
||||
local remaining_use = math.round(use - (stack:get_wear() * use) / 65535)
|
||||
return S("Durability: @1", S("@1 uses", remaining_use .."/".. use))
|
||||
end
|
||||
end)
|
||||
|
@ -227,6 +227,7 @@ local dispenserdef = {
|
||||
entity.gotten = true
|
||||
minetest.sound_play("mcl_tools_shears_cut", { pos = pos }, true)
|
||||
stack:add_wear(65535 / stackdef._mcl_diggroups.shearsy.uses)
|
||||
tt.reload_itemstack_description(stack) -- update tooltip
|
||||
inv:set_stack("main", stack_id, stack)
|
||||
break
|
||||
end
|
||||
|
@ -300,6 +300,7 @@ controls.register_on_release(function(player, key, time)
|
||||
durability = durability * (unbreaking + 1)
|
||||
end
|
||||
wielditem:add_wear(65535/durability)
|
||||
tt.reload_itemstack_description(wielditem) -- update tooltip
|
||||
end
|
||||
player:set_wielded_item(wielditem)
|
||||
reset_bow_state(player, true)
|
||||
|
@ -350,6 +350,7 @@ controls.register_on_press(function(player, key, time)
|
||||
durability = durability / 3
|
||||
end
|
||||
wielditem:add_wear(65535/durability)
|
||||
tt.reload_itemstack_description(wielditem) -- update tooltip
|
||||
end
|
||||
player:set_wielded_item(wielditem)
|
||||
reset_bow_state(player, true)
|
||||
|
@ -323,6 +323,7 @@ function mcl_campfires.register_campfire(name, def)
|
||||
local wear = mcl_autogroup.get_wear(toolname, "shovely")
|
||||
if wear then
|
||||
itemstack:add_wear(wear)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
end
|
||||
node.name = name
|
||||
|
@ -485,6 +485,7 @@ mcl_experience.register_on_add_xp(function(player, xp)
|
||||
end
|
||||
|
||||
stack:set_wear(math.floor(new_wear))
|
||||
tt.reload_itemstack_description(stack) -- update tooltip
|
||||
inv:set_stack(list, index, stack)
|
||||
end
|
||||
|
||||
|
@ -43,6 +43,7 @@ local hoe_on_place_function = function(wear_divisor)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
itemstack:add_wear(65535/wear_divisor)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
@ -54,7 +55,7 @@ local uses = {
|
||||
stone = 132,
|
||||
iron = 251,
|
||||
gold = 33,
|
||||
diamond = 1562,
|
||||
diamond = 1562,
|
||||
netherite = 2031,
|
||||
}
|
||||
|
||||
@ -274,26 +275,26 @@ minetest.register_craft({
|
||||
{"mcl_core:diamond", "mcl_core:diamond"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_netherite", {
|
||||
description = S("Netherite Hoe"),
|
||||
_tt_help = hoe_tt.."\n"..S("Uses: @1", uses.netherite),
|
||||
_doc_items_longdesc = hoe_longdesc,
|
||||
_doc_items_usagehelp = hoe_usagehelp,
|
||||
inventory_image = "farming_tool_netheritehoe.png",
|
||||
wield_scale = mcl_vars.tool_wield_scale,
|
||||
on_place = hoe_on_place_function(uses.netherite),
|
||||
groups = { tool=1, hoe=1, enchantability=10, fire_immune=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.25,
|
||||
damage_groups = { fleshy = 4, },
|
||||
punch_attack_uses = uses.netherite,
|
||||
},
|
||||
_repair_material = "mcl_nether:netherite_ingot",
|
||||
_mcl_toollike_wield = true,
|
||||
_mcl_diggroups = {
|
||||
hoey = { speed = 8, level = 5, uses = uses.netherite }
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_netherite", {
|
||||
description = S("Netherite Hoe"),
|
||||
_tt_help = hoe_tt.."\n"..S("Uses: @1", uses.netherite),
|
||||
_doc_items_longdesc = hoe_longdesc,
|
||||
_doc_items_usagehelp = hoe_usagehelp,
|
||||
inventory_image = "farming_tool_netheritehoe.png",
|
||||
wield_scale = mcl_vars.tool_wield_scale,
|
||||
on_place = hoe_on_place_function(uses.netherite),
|
||||
groups = { tool=1, hoe=1, enchantability=10, fire_immune=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.25,
|
||||
damage_groups = { fleshy = 4, },
|
||||
punch_attack_uses = uses.netherite,
|
||||
},
|
||||
_repair_material = "mcl_nether:netherite_ingot",
|
||||
_mcl_toollike_wield = true,
|
||||
_mcl_diggroups = {
|
||||
hoey = { speed = 8, level = 5, uses = uses.netherite }
|
||||
},
|
||||
})
|
||||
|
@ -1,6 +1,7 @@
|
||||
--Fishing Rod, Bobber, and Flying Bobber mechanics and Bobber artwork by Rootyjr.
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local FISHING_ROD_DURABILITY = 65
|
||||
|
||||
local bobber_ENTITY={
|
||||
physical = false,
|
||||
@ -38,7 +39,7 @@ local fish = function(itemstack, player, pointed_thing)
|
||||
local ent = nil
|
||||
local noent = true
|
||||
|
||||
local durability = 65
|
||||
local durability = FISHING_ROD_DURABILITY
|
||||
local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking")
|
||||
if unbreaking > 0 then
|
||||
durability = durability * (unbreaking + 1)
|
||||
@ -140,6 +141,7 @@ local fish = function(itemstack, player, pointed_thing)
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
local idef = itemstack:get_definition()
|
||||
itemstack:add_wear(65535/durability) -- 65 uses
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
|
||||
minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true)
|
||||
end
|
||||
@ -154,6 +156,7 @@ local fish = function(itemstack, player, pointed_thing)
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
local idef = itemstack:get_definition()
|
||||
itemstack:add_wear((65535/durability)*2) -- if so and not creative then wear double like in MC.
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
|
||||
minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true)
|
||||
end
|
||||
|
@ -186,6 +186,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
|
||||
local wear = mcl_autogroup.get_wear(toolname, "shovely")
|
||||
if wear then
|
||||
itemstack:add_wear(wear)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
end
|
||||
minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above, max_hear_distance = 16}, true)
|
||||
@ -209,6 +210,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
|
||||
local wear = mcl_autogroup.get_wear(toolname, "shovely")
|
||||
if wear then
|
||||
itemstack:add_wear(wear)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
end
|
||||
minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above, max_hear_distance = 16}, true)
|
||||
@ -240,6 +242,7 @@ if minetest.get_modpath("mcl_farming") then
|
||||
local wear = mcl_autogroup.get_wear(toolname, "shearsy")
|
||||
if wear then
|
||||
itemstack:add_wear(wear)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
|
||||
end
|
||||
@ -420,6 +423,7 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing)
|
||||
local wear = mcl_autogroup.get_wear(toolname, "axey")
|
||||
if wear then
|
||||
itemstack:add_wear(wear)
|
||||
tt.reload_itemstack_description(itemstack) -- update tooltip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user