Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into world-overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandertv committed Nov 13, 2024
2 parents f8af8cf + c5d09f3 commit f6e01c3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/blockhash/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (b *hashBuilder) ftype(structName, s string, expr ast.Expr, directives map[
case "WoodType", "FlowerType", "DoubleFlowerType", "Colour":
// Assuming these were all based on metadata, it should be safe to assume a bit size of 4 for this.
return "uint64(" + s + ".Uint8())", 4
case "CoralType":
case "CoralType", "SkullType":
return "uint64(" + s + ".Uint8())", 3
case "AnvilType", "SandstoneType", "PrismarineType", "StoneBricksType", "NetherBricksType", "FroglightType", "WallConnectionType", "BlackstoneType", "DeepslateType", "TallGrassType":
return "uint64(" + s + ".Uint8())", 2
Expand Down
2 changes: 1 addition & 1 deletion server/block/hash.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions server/block/skull.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ func (s Skull) EncodeBlock() (string, map[string]interface{}) {

// allSkulls ...
func allSkulls() (skulls []world.Block) {
for _, f := range cube.HorizontalFaces() {
// A direction of -2 and -1 isn't actually valid, but when encoding the block these are encoded as 0 and 1. We
// can't otherwise represent this properly in an Attachment type.
skulls = append(skulls, Skull{Attach: WallAttachment(f.Direction())})
for _, t := range SkullTypes() {
for _, d := range cube.Directions() {
skulls = append(skulls, Skull{Type: t, Attach: WallAttachment(d)})
}
skulls = append(skulls, Skull{Type: t, Attach: StandingAttachment(0)})
}
return append(skulls, Skull{Attach: StandingAttachment(0)})
return
}
2 changes: 1 addition & 1 deletion server/player/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (t Type) Open(tx *world.Tx, handle *world.EntityHandle, data *world.EntityD
}

func (Type) EncodeEntity() string { return "minecraft:player" }
func (Type) NetworkOffset() float64 { return 1.62 }
func (Type) NetworkOffset() float64 { return 1.621 }
func (Type) BBox(e world.Entity) cube.BBox {
p := e.(*Player)
s := p.Scale()
Expand Down

0 comments on commit f6e01c3

Please sign in to comment.