Skip to content

Commit

Permalink
block/skull: Rotation is a float
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Jul 11, 2024
1 parent ee3833a commit 56780ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/block/skull.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (s Skull) EncodeItem() (name string, meta int16) {
// DecodeNBT ...
func (s Skull) DecodeNBT(data map[string]interface{}) interface{} {
s.Type = SkullType{skull(nbtconv.Uint8(data, "SkullType"))}
s.Attach.o = cube.Orientation(nbtconv.Uint8(data, "Rotation"))
s.Attach.o = cube.OrientationFromYaw(float64(nbtconv.Float32(data, "Rotation")))
if s.Attach.facing >= 0 {
s.Attach.hanging = true
}
Expand All @@ -98,7 +98,7 @@ func (s Skull) DecodeNBT(data map[string]interface{}) interface{} {

// EncodeNBT ...
func (s Skull) EncodeNBT() map[string]interface{} {
return map[string]interface{}{"id": "Skull", "SkullType": s.Type.Uint8(), "Rotation": byte(s.Attach.o)}
return map[string]interface{}{"id": "Skull", "SkullType": s.Type.Uint8(), "Rotation": float32(s.Attach.o.Yaw())}
}

// EncodeBlock ...
Expand Down

0 comments on commit 56780ca

Please sign in to comment.