Repeat locked strata across columns above the reference height

Above y=512 the locked-layer offset went negative and every block clamped to the first stratum; floorMod keeps the strata cycling.
Upstream: 23bad0e1a
This commit is contained in:
piexel committed 2026-11-10 10:02:32 +01:00
1 parent 2bdc3cdc93
commit 5a2c5b2592
2 files changed
+76 -2

No files matched your search

@@ -273,8 +273,8 @@ public final class BiomeLayers {
}
for (int i = 0; i < maxDepth; i++) {
int offset = (LOCKED_LAYERS_REFERENCE_HEIGHT - height) - i;
locked.add(stacked.get(Math.max(offset % stacked.size(), 0)));
long offset = (long) LOCKED_LAYERS_REFERENCE_HEIGHT - height - i;
locked.add(stacked.get(Math.floorMod(offset, stacked.size())));
}
return locked;