Skip to content

Commit

Permalink
player/player.go: Directly set velocity.
Browse files Browse the repository at this point in the history
  • Loading branch information
JustTalDevelops committed Jul 15, 2022
1 parent 9cd90fe commit 7a9f47a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,8 @@ func (p *Player) FinalDamageFrom(dmg float64, src damage.Source) float64 {

// Explode ...
func (p *Player) Explode(c block.ExplosionConfig, impact float64) {
fmt.Println(impact)
p.Hurt(math.Floor((impact*impact+impact)*3.5*c.Radius+1), damage.SourceExplosion{})

v := p.Position().Sub(c.Pos).Normalize()
p.KnockBack(c.Pos, impact, v[1]*impact)
p.SetVelocity(p.Position().Sub(c.Pos).Normalize().Mul(impact))

This comment has been minimized.

Copy link
@T14Raptor

T14Raptor Jul 15, 2022

Member

This causes knockback resistance to be ignored

}

// protectionEnchantment represents an enchantment that can protect the player from damage.
Expand Down

0 comments on commit 7a9f47a

Please sign in to comment.