properly apply entity scale
This commit is contained in:
parent
a746dee75b
commit
04293a74c5
|
@ -71,6 +71,7 @@ func (w *WorldState) processAddActor(pk *packet.AddActor) {
|
|||
w.bp.AddEntity(behaviourpack.EntityIn{
|
||||
Identifier: pk.EntityType,
|
||||
Attr: pk.Attributes,
|
||||
Meta: pk.EntityMetadata,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -103,9 +104,6 @@ func entityMetadataToNBT(metadata protocol.EntityMetadata, nbt map[string]any) {
|
|||
nbt["CustomNameVisible"] = false
|
||||
}
|
||||
}
|
||||
if scale, ok := metadata[protocol.EntityDataKeyScale].(float32); ok {
|
||||
nbt["Scale"] = scale
|
||||
}
|
||||
}
|
||||
|
||||
func vec3float32(x mgl32.Vec3) []float32 {
|
||||
|
|
|
@ -24,6 +24,7 @@ type entityBehaviour struct {
|
|||
type EntityIn struct {
|
||||
Identifier string
|
||||
Attr []protocol.AttributeValue
|
||||
Meta map[uint32]any
|
||||
}
|
||||
|
||||
func (bp *BehaviourPack) AddEntity(entity EntityIn) {
|
||||
|
@ -64,5 +65,11 @@ func (bp *BehaviourPack) AddEntity(entity EntityIn) {
|
|||
}
|
||||
}
|
||||
|
||||
if scale, ok := entity.Meta[protocol.EntityDataKeyScale].(float32); ok {
|
||||
entry.MinecraftEntity.Components["minecraft:scale"] = map[string]any{
|
||||
"value": scale,
|
||||
}
|
||||
}
|
||||
|
||||
bp.entities[entity.Identifier] = entry
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue