Skip the boundary field for plain floating-island parent lookups

Parent lookups built the whole boundary field per column even where no floating child needs edge distances, and the noise biome cache bound was checked on every insert. Parent lookups now read the biome source directly, and the cache bound is checked only at quart y multiples of 64.

Upstream: f2236a848 8b5c109d5
This commit is contained in:
piexel committed 2026-11-10 01:01:09 +01:00
1 parent 39e4015b44
commit 8c489e4a26
3 files changed
+8 -13

No files matched your search

@@ -93,20 +93,18 @@ public class FloatingIslandBoundarySamplerTest {
}
@Test
public void parent_cachesResolvedBiomeColumns() {
public void parent_readsOnlyTheQueriedColumnWithoutBuildingTheBoundaryField() {
ResourceId parent = ResourceId.parse("ns:parent");
ResourceId other = ResourceId.parse("ns:other");
AtomicInteger calls = new AtomicInteger();
FloatingIslandBoundarySampler sampler = new FloatingIslandBoundarySampler((x, z) -> {
calls.incrementAndGet();
return parent;
return x == 12 && z == -9 ? parent : other;
});
assertSame(parent, sampler.parent(12, -9));
int firstReadCount = calls.get();
assertSame(parent, sampler.parent(12, -9));
assertEquals(firstReadCount, calls.get());
int rawWidth = 16 + (FloatingIslandBoundarySampler.EDGE_FADE_RADIUS * 2) + 2;
assertEquals(rawWidth * rawWidth, firstReadCount);
assertSame(other, sampler.parent(13, -9));
assertEquals(2, calls.get());
}
@Test