Skip to content

Commit

Permalink
chunk/encoding.go: Fix staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Sep 8, 2024
1 parent b4ac40c commit 695963b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/world/chunk/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (blockPaletteEncoding) decode(buf *bytes.Buffer) (uint32, error) {
version, _ := m["version"].(int32)

// Now check for a state field.
stateI, _ := m["states"]
stateI, ok := m["states"]
if version < 17694723 {
// This entry is a pre-1.13 block state, so decode the meta value instead.
meta, _ := m["val"].(int16)
Expand All @@ -83,7 +83,7 @@ func (blockPaletteEncoding) decode(buf *bytes.Buffer) (uint32, error) {
name = state.Name
stateI = state.State
version = state.Version
} else if stateI == nil {
} else if !ok {
// The state is a post-1.13 block state, but the states field is missing, likely due to a broken world
// conversion.
stateI = make(map[string]any)
Expand Down

0 comments on commit 695963b

Please sign in to comment.