Change the underwater detection code a bit

This commit is contained in:
FossFanatic 2023-01-27 16:29:24 +00:00 committed by Gitea
parent 24b1078b61
commit 0c0845c1bd
1 changed files with 6 additions and 1 deletions

View File

@ -395,8 +395,13 @@ minetest.register_globalstep(function(dtime)
set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0))
end
if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 or get_item_group(mcl_playerinfo[name].node_head, "water") ~= 1 then
local underwater
if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and underwater ~= true then
mcl_weather.skycolor.update_sky_color()
local underwater = true
elseif get_item_group(mcl_playerinfo[name].node_head, "water") == 0 and underwater == true then
mcl_weather.skycolor.update_sky_color()
local underwater = false
end
elytra.last_yaw = player:get_look_horizontal()