From 6e71a3ef960e34bf2e40e030a604e077d72c636d Mon Sep 17 00:00:00 2001 From: TwistedAsylumMC Date: Tue, 3 Sep 2024 11:44:13 +0100 Subject: [PATCH] world/block.go: Document math.MaxUint64 usage --- server/world/block.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/world/block.go b/server/world/block.go index 744a7d03c..c628a4771 100644 --- a/server/world/block.go +++ b/server/world/block.go @@ -128,6 +128,7 @@ func finaliseBlockRegistry() { for rid, b := range blocks { finaliseBlock(uint32(rid), b) if b.Hash() != math.MaxUint64 { + // b is not an unknownBlock. h := int64(BlockHash(b)) if other, ok := hashes.Get(h); ok { panic(fmt.Sprintf("block %#v with hash %v already registered by %#v", b, h, blocks[other])) @@ -181,6 +182,7 @@ func BlockRuntimeID(b Block) uint32 { return airRID } if h := BlockHash(b); h != math.MaxUint64 { + // b is not an unknownBlock. if rid, ok := hashes.Get(int64(h)); ok { return uint32(rid) }