From cf85ea37691640b540e942d1aea15dc0edcb7514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emin=20Ar=C4=B1can?= Date: Tue, 5 Dec 2023 22:05:58 +0300 Subject: [PATCH] elytra fix --- server/player/player.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/player/player.go b/server/player/player.go index dcda971d3..e7c8bd39c 100644 --- a/server/player/player.go +++ b/server/player/player.go @@ -1946,15 +1946,17 @@ func (p *Player) Move(deltaPos mgl64.Vec3, deltaYaw, deltaPitch float64) { horizontalVel := deltaPos horizontalVel[1] = 0 + if p.Gliding() { if deltaPos.Y() >= -0.5 { p.fallDistance.Store(1.0) } - if p.collidedHorizontally.Load() { - if force := horizontalVel.Len()*10.0 - 3.0; force > 0.0 && !p.AttackImmune() { + if p.collidedVertically.Load() { + if force := deltaPos.Y()*10.0 - 3.0; force > 0.0 && !p.AttackImmune() { w.PlaySound(p.Position(), sound.Fall{Distance: force}) p.Hurt(force, entity.GlideDamageSource{}) } + p.StopGliding() } }