Correctly refresh enchantment tool capabilities in mcl_potions haste/fatigue effects (#4355)

Reviewed-on: VoxeLibre/VoxeLibre#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:
teknomunk 2024-06-01 23:25:42 +00:00 committed by the-real-herowl
parent beccbacc73
commit ca033d0e8d
1 changed files with 2 additions and 0 deletions

View File

@ -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)
else meta:set_string("mcl_potions:fatigue", "") end
meta:set_tool_capabilities()
meta:set_string("groupcaps_hash","")
mcl_enchanting.update_groupcaps(item)
if h_fac == 0 and f_fac == 1 then
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:fatigue", "")
meta:set_tool_capabilities()
meta:set_string("groupcaps_hash","")
mcl_enchanting.update_groupcaps(item)
end
end