Skip to content

Commit 9c64efe

Browse files
authored
entity/firework_behaviour.go: Remove unnecessary velocity update when attached (#1038)
* entity/firework_behaviour.go * Update firework_behaviour.go
1 parent d54fd48 commit 9c64efe

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

server/entity/firework_behaviour.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"github.com/df-mc/dragonfly/server/item"
66
"github.com/df-mc/dragonfly/server/world"
77
"github.com/df-mc/dragonfly/server/world/sound"
8-
"github.com/go-gl/mathgl/mgl64"
98
"iter"
109
"math"
1110
"time"
@@ -77,21 +76,10 @@ func (f *FireworkBehaviour) Tick(e *Ent, tx *world.Tx) *Movement {
7776
// or based on the owner's position and velocity if attached.
7877
func (f *FireworkBehaviour) tick(e *Ent, tx *world.Tx) {
7978
owner, ok := f.conf.Owner.Entity(tx)
80-
81-
var ownerVel mgl64.Vec3
82-
if o, ok := owner.(interface {
83-
Velocity() mgl64.Vec3
84-
}); ok {
85-
ownerVel = o.Velocity()
86-
}
87-
8879
if f.conf.Attached && ok {
89-
dV := owner.Rotation().Vec3()
90-
9180
// The client will propel itself to match the firework's velocity since
9281
// we set the appropriate metadata.
9382
e.data.Pos = owner.Position()
94-
e.data.Vel = e.data.Vel.Add(ownerVel.Add(dV.Mul(0.1).Add(dV.Mul(1.5).Sub(ownerVel).Mul(0.5))))
9583
} else {
9684
e.data.Vel[0] *= f.conf.SidewaysVelocityMultiplier
9785
e.data.Vel[1] += f.conf.UpwardsAcceleration

0 commit comments

Comments
 (0)