Skip to content

Commit

Permalink
Correctly enconding effects
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanCraft623 committed Aug 10, 2024
1 parent 45cf3f1 commit 74325db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/session/entity_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,16 @@ func (s *Session) addSpecificMetadata(e any, m protocol.EntityMetadata) {
if eff, ok := e.(effectBearer); ok {
var packedEffects int64

for i, ef := range eff.Effects() {
for _, ef := range eff.Effects() {
if !ef.ParticlesHidden() {
id, found := effect.ID(ef.Type())
if !found {
continue
}
packedEffects = (packedEffects << (i * 7)) | int64(id<<1)
packedEffects = (packedEffects << 7) | int64(id << 1)
if ef.Ambient() {
packedEffects |= 1
}
}
}
m[protocol.EntityDataKeyVisibleMobEffects] = packedEffects
Expand Down

0 comments on commit 74325db

Please sign in to comment.