1
0
Fork 0

Potion Fixes:

Ensure all potion icons disappear after their effect is gone.
Stop Breath bar from flashing when water_breathing is in effect.
mobs_head_rotation
MysticTempest 2022-05-09 05:18:59 -05:00
parent 1565999134
commit 44b1d583a7
1 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,8 @@ minetest.register_globalstep(function(dtime)
meta = player:get_meta() meta = player:get_meta()
meta:set_string("_is_invisible", minetest.serialize(EF.invisible[player])) meta:set_string("_is_invisible", minetest.serialize(EF.invisible[player]))
end end
potions_set_hud(player)
end end
end end
@ -195,6 +197,7 @@ minetest.register_globalstep(function(dtime)
if player:get_pos() then mcl_potions._add_spawner(player, "#2E5299") end if player:get_pos() then mcl_potions._add_spawner(player, "#2E5299") end
if player:get_breath() then if player:get_breath() then
hb.hide_hudbar(player, "breath")
if player:get_breath() < 10 then player:set_breath(10) end if player:get_breath() < 10 then player:set_breath(10) end
end end
@ -203,6 +206,7 @@ minetest.register_globalstep(function(dtime)
meta:set_string("_is_water_breathing", minetest.serialize(EF.water_breathing[player])) meta:set_string("_is_water_breathing", minetest.serialize(EF.water_breathing[player]))
EF.water_breathing[player] = nil EF.water_breathing[player] = nil
end end
potions_set_hud(player)
else else
EF.water_breathing[player] = nil EF.water_breathing[player] = nil
@ -225,6 +229,7 @@ minetest.register_globalstep(function(dtime)
meta = player:get_meta() meta = player:get_meta()
meta:set_string("_is_leaping", minetest.serialize(EF.leaping[player])) meta:set_string("_is_leaping", minetest.serialize(EF.leaping[player]))
end end
potions_set_hud(player)
else else
EF.leaping[player] = nil EF.leaping[player] = nil
@ -247,6 +252,7 @@ minetest.register_globalstep(function(dtime)
meta = player:get_meta() meta = player:get_meta()
meta:set_string("_is_swift", minetest.serialize(EF.swift[player])) meta:set_string("_is_swift", minetest.serialize(EF.swift[player]))
end end
potions_set_hud(player)
else else
EF.swift[player] = nil EF.swift[player] = nil
@ -270,6 +276,7 @@ minetest.register_globalstep(function(dtime)
meta:set_int("night_vision", 0) meta:set_int("night_vision", 0)
end end
mcl_weather.skycolor.update_sky_color({player}) mcl_weather.skycolor.update_sky_color({player})
potions_set_hud(player)
else else
EF.night_vision[player] = nil EF.night_vision[player] = nil
@ -293,6 +300,7 @@ minetest.register_globalstep(function(dtime)
meta = player:get_meta() meta = player:get_meta()
meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player])) meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player]))
end end
potions_set_hud(player)
else else
EF.fire_proof[player] = nil EF.fire_proof[player] = nil