Skip to content

Fix chunk indexing in world previews - #2517

Merged
FormallyMyles merged 2 commits into
HiveGamesOSS:developfrom
xIGBClutchIx:fix/chunk-coordinate-index
Aug 19, 2026
Merged

Fix chunk indexing in world previews#2517
FormallyMyles merged 2 commits into
HiveGamesOSS:developfrom
xIGBClutchIx:fix/chunk-coordinate-index

Conversation

@xIGBClutchIx

Copy link
Copy Markdown

Summary

Fix overlapping chunk positions in world previews.

World previews store the chunks in each 32×32 region using a 10-bit index. The X coordinate was shifted by four bits instead of five, causing different chunk positions to share the same index.

What changed

  • Shift the X coordinate by the correct five bits.
  • Add a regression test covering every position in a 32×32 region.

Impact

All 1,024 possible chunk positions in a region now receive unique indexes instead of overlapping.

Validation

  • ./gradlew :cli:test --tests com.hivemc.chunker.conversion.intermediate.column.chunk.ChunkCoordPairTests
  • The test verifies that all 1,024 indexes are unique and cover the expected 0 through 1023 range.
@xIGBClutchIx
xIGBClutchIx requested a review from a team as a code owner August 12, 2026 06:44
@FormallyMyles
FormallyMyles merged commit 90255d4 into HiveGamesOSS:develop Aug 19, 2026
1 check passed
@FormallyMyles

Copy link
Copy Markdown
Collaborator

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants