diff --git a/bot/world/chunk.go b/bot/world/chunk.go index 36fc3a1..bf0342a 100644 --- a/bot/world/chunk.go +++ b/bot/world/chunk.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/Tnze/go-mc/data" pk "github.com/Tnze/go-mc/net/packet" - "math" ) // DecodeChunkColumn decode the chunk data structure. @@ -117,11 +116,12 @@ func (d *directSection) GetBlock(offset int) BlockStatus { func (d *directSection) SetBlock(offset int, s BlockStatus) { offset *= d.bpb padding := offset % 64 - mask := uint64(math.MaxUint64<<(padding+d.bpb) | (1< 64-d.bpb { l := padding - (64 - d.bpb) - d.data[offset/64+1] = d.data[offset/64+1]&(math.MaxUint64<>(64-padding) + const maxUint64 = 1<<64 - 1 + d.data[offset/64+1] = d.data[offset/64+1]&(maxUint64<>(64-padding) } }