mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Correctly refresh enchantment tool capabilities in mcl_potions haste/fatigue effects (#4355)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4355 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: teknomunk <teknomunk@protonmail.com> Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
parent
beccbacc73
commit
ca033d0e8d
1 changed files with 2 additions and 0 deletions
|
@ -1091,6 +1091,7 @@ function mcl_potions.update_haste_and_fatigue(player)
|
||||||
if f_fac ~= 1 then meta:set_float("mcl_potions:fatigue", 1 - f_fac)
|
if f_fac ~= 1 then meta:set_float("mcl_potions:fatigue", 1 - f_fac)
|
||||||
else meta:set_string("mcl_potions:fatigue", "") end
|
else meta:set_string("mcl_potions:fatigue", "") end
|
||||||
meta:set_tool_capabilities()
|
meta:set_tool_capabilities()
|
||||||
|
meta:set_string("groupcaps_hash","")
|
||||||
mcl_enchanting.update_groupcaps(item)
|
mcl_enchanting.update_groupcaps(item)
|
||||||
if h_fac == 0 and f_fac == 1 then
|
if h_fac == 0 and f_fac == 1 then
|
||||||
player:set_wielded_item(item)
|
player:set_wielded_item(item)
|
||||||
|
@ -1399,6 +1400,7 @@ function mcl_potions._reset_haste_fatigue_item_meta(player)
|
||||||
meta:set_string("mcl_potions:haste", "")
|
meta:set_string("mcl_potions:haste", "")
|
||||||
meta:set_string("mcl_potions:fatigue", "")
|
meta:set_string("mcl_potions:fatigue", "")
|
||||||
meta:set_tool_capabilities()
|
meta:set_tool_capabilities()
|
||||||
|
meta:set_string("groupcaps_hash","")
|
||||||
mcl_enchanting.update_groupcaps(item)
|
mcl_enchanting.update_groupcaps(item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue