diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index e915efbe2a..6c521be72d 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -91,7 +91,7 @@ local function update_player_textures(player) end player:set_properties({ textures = textures }) - + -- Delay calling the callbacks because mods (including mcl_player) -- need to fully initialize player data from minetest.register_on_joinplayer -- before callbacks run @@ -234,6 +234,8 @@ minetest.register_globalstep(function(dtime) -- Apply animations based on what the player is doing if player:get_hp() == 0 then player_set_animation(player, "die") + elseif mcl_playerplus.elytra[player] and mcl_playerplus.elytra[player].active then + player_set_animation(player, "stand") elseif walking and velocity.x > 0.35 or walking and velocity.x < -0.35 or walking and velocity.z > 0.35 diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 85cfaf5610..65e107a440 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -196,6 +196,10 @@ minetest.register_globalstep(function(dtime) elytra.speed = 0 end + if not elytra.last_yaw then + elytra.last_yaw = player:get_look_horizontal() + end + local is_just_jumped = control.jump and not mcl_playerplus.is_pressing_jump[name] and not elytra.active mcl_playerplus.is_pressing_jump[name] = control.jump if is_just_jumped and not elytra.active then @@ -314,7 +318,7 @@ minetest.register_globalstep(function(dtime) if elytra.active then -- set head pitch and yaw when flying - set_bone_position_conditional(player,"Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0)) + set_bone_position_conditional(player,"Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity))+50,player_vel_yaw - yaw,0)) -- sets eye height, and nametag color accordingly set_properties_conditional(player,{collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) -- control body bone when flying @@ -349,6 +353,7 @@ minetest.register_globalstep(function(dtime) set_bone_position_conditional(player,"Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0)) end + elytra.last_yaw = player:get_look_horizontal() -- Update jump status immediately since we need this info in real time. -- WARNING: This section is HACKY as hell since it is all just based on heuristics.