0
0
Fork 0

Merge pull request 'Potion Fixes:' (#2191) from Fix_waterbreathing_and_potion_icons into master

Reviewed-on: MineClone2/MineClone2#2191
Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
cora 2022-05-09 10:25:51 +00:00
commit 7c263c6a18
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