mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-10 02:01:07 +01:00
Correct conditions for water-air transition forced skycolor update
This commit is contained in:
parent
cb097d9bcd
commit
0e1a2cbc1e
1 changed files with 24 additions and 7 deletions
|
@ -407,13 +407,30 @@ minetest.register_globalstep(function(dtime)
|
|||
set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0))
|
||||
end
|
||||
|
||||
local underwater
|
||||
if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and underwater ~= true then
|
||||
local playerinfo = mcl_playerinfo[name] or {}
|
||||
local plusinfo = playerinfo.mcl_playerplus
|
||||
if not plusinfo then
|
||||
plusinfo = {}
|
||||
playerinfo.mcl_playerplus = plusinfo
|
||||
end
|
||||
|
||||
-- Only process if node_head changed
|
||||
if plusinfo.old_node_head ~= playerinfo.node_head then
|
||||
local node_head = playerinfo.node_head or ""
|
||||
local old_node_head = plusinfo.old_node_head or ""
|
||||
plusinfo.old_node_head = playerinfo.node_head
|
||||
|
||||
minetest.log(dump({
|
||||
node_head = node_head,
|
||||
old_node_head = old_node_head,
|
||||
new_group = get_item_group(node_head, "water"),
|
||||
old_group = get_item_group(old_node_head, "water"),
|
||||
}))
|
||||
|
||||
-- Update skycolor if moving in or out of water
|
||||
if (get_item_group(node_head, "water") == 0) ~= (get_item_group(old_node_head, "water") == 0) 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
|
||||
end
|
||||
|
||||
elytra.last_yaw = player:get_look_horizontal()
|
||||
|
|
Loading…
Reference in a new issue