Skip to content

Commit

Permalink
Merge upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 4, 2024
2 parents 5630455 + 45cf3f1 commit 201b90d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/google/uuid v1.6.0
github.com/pelletier/go-toml v1.9.5
github.com/rogpeppe/go-internal v1.11.0
github.com/sandertv/gophertunnel v1.39.0
github.com/sandertv/gophertunnel v1.39.3
github.com/segmentio/fasthash v1.0.3
github.com/sirupsen/logrus v1.9.3
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/sandertv/go-raknet v1.14.1 h1:V2Gslo+0x4jfj+p0PM48mWxmMbYkxSlgeKy//y3ZrzI=
github.com/sandertv/go-raknet v1.14.1/go.mod h1:/yysjwfCXm2+2OY8mBazLzcxJ3irnylKCyG3FLgUPVU=
github.com/sandertv/gophertunnel v1.39.0 h1:Am2NhSQjxscAVihRG/Qz7cfyJJp91RIl/5DpSLbwXp0=
github.com/sandertv/gophertunnel v1.39.0/go.mod h1:uSaX7RbVaCcxsGAx2vyZnkT0M6kZFGCdAqLn0+wuKyY=
github.com/sandertv/gophertunnel v1.39.3 h1:oc0PPOhrB9utScy8SEYJTWQIFexzf8CVizmB5MLsb6A=
github.com/sandertv/gophertunnel v1.39.3/go.mod h1:uSaX7RbVaCcxsGAx2vyZnkT0M6kZFGCdAqLn0+wuKyY=
github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
Expand Down
23 changes: 10 additions & 13 deletions server/session/entity_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,19 @@ func (s *Session) addSpecificMetadata(e any, m protocol.EntityMetadata) {
m[protocol.EntityDataKeyCustomDisplay] = tip + 1
}
}
if eff, ok := e.(effectBearer); ok && len(eff.Effects()) > 0 {
visibleEffects := make([]effect.Effect, 0, len(eff.Effects()))
for _, ef := range eff.Effects() {
if eff, ok := e.(effectBearer); ok {
var packedEffects int64

for i, ef := range eff.Effects() {
if !ef.ParticlesHidden() {
visibleEffects = append(visibleEffects, ef)
}
}
if len(visibleEffects) > 0 {
colour, am := effect.ResultingColour(visibleEffects)
m[protocol.EntityDataKeyEffectColor] = nbtconv.Int32FromRGBA(colour)
if am {
m[protocol.EntityDataKeyEffectAmbience] = byte(1)
} else {
m[protocol.EntityDataKeyEffectAmbience] = byte(0)
id, found := effect.ID(ef.Type())
if !found {
continue
}
packedEffects = (packedEffects << (i * 7)) | int64(id<<1)
}
}
m[protocol.EntityDataKeyVisibleMobEffects] = packedEffects
}
if v, ok := e.(variable); ok {
m[protocol.EntityDataKeyVariant] = v.Variant()
Expand Down

0 comments on commit 201b90d

Please sign in to comment.