Skip to content

Commit

Permalink
elytra fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eminarican committed Dec 5, 2023
1 parent 43bbbd0 commit cf85ea3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit cf85ea3

Please sign in to comment.