Skip floating fields for plain parents

- parent biome lookups read the biome stream directly instead of building the boundary field
- fields are only built where a parent with floating children needs edge distances
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-28 11:26:41 -04:00
1 parent 1df51b230d
commit f2236a8482
2 files changed
+6 -12

No files matched your search

@@ -103,20 +103,18 @@ public class FloatingIslandBoundarySamplerTest {
}
@Test
public void parent_cachesResolvedBiomeColumns() {
public void parent_readsOnlyTheQueriedColumnWithoutBuildingTheBoundaryField() {
IrisBiome parent = new IrisBiome();
IrisBiome other = new IrisBiome();
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