From 0c0845c1bd189d222115d744c74f41a2a7dbd6d8 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 27 Jan 2023 16:29:24 +0000 Subject: [PATCH] Change the underwater detection code a bit --- mods/PLAYER/mcl_playerplus/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index e01a7bd12..0e774ee2f 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -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()