Skip to content

Commit

Permalink
world/block.go: Fix incorrect unknownBlock hash checking
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Sep 9, 2024
1 parent 5fe94f9 commit ae7c8ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/world/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ func BlockRuntimeID(b Block) uint32 {
if b == nil {
return airRID
}
if h := BlockHash(b); h != math.MaxUint64 {
if _, h := b.Hash(); h != math.MaxUint64 {
// b is not an unknownBlock.
if rid, ok := hashes.Get(int64(h)); ok {
if rid, ok := hashes.Get(int64(BlockHash(b))); ok {
return uint32(rid)
}
panic(fmt.Sprintf("cannot find block by non-0 hash of block %#v", b))
Expand Down

0 comments on commit ae7c8ed

Please sign in to comment.