diff --git a/server/session/entity_metadata.go b/server/session/entity_metadata.go index c563ab064..cc804c072 100644 --- a/server/session/entity_metadata.go +++ b/server/session/entity_metadata.go @@ -25,7 +25,6 @@ func (s *Session) parseEntityMetadata(e world.Entity) protocol.EntityMetadata { m[protocol.EntityDataKeyEffectColor] = int32(0) m[protocol.EntityDataKeyEffectAmbience] = byte(0) m[protocol.EntityDataKeyColorIndex] = byte(0) - m[protocol.EntityDataKeyHasNPC] = uint8(1) m.SetFlag(protocol.EntityDataKeyFlags, protocol.EntityDataFlagHasGravity) m.SetFlag(protocol.EntityDataKeyFlags, protocol.EntityDataFlagClimb) @@ -164,6 +163,9 @@ func (s *Session) addSpecificMetadata(e any, m protocol.EntityMetadata) { } m[protocol.EntityDataKeyVisibleMobEffects] = packedEffects } + if d, ok := e.(dialogueProvider); ok { + m[protocol.EntityDataKeyHasNPC] = boolByte(d.CanShowDialogue()) + } if v, ok := e.(variable); ok { m[protocol.EntityDataKeyVariant] = v.Variant() } @@ -273,6 +275,10 @@ type living interface { DeathPosition() (mgl64.Vec3, world.Dimension, bool) } +type dialogueProvider interface { + CanShowDialogue() bool +} + type variable interface { Variant() int32 }