mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-25 13:30:08 +00:00
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:
1 parent
1df51b230d
commit
f2236a8482
2 files changed
+6
-12
No files matched your search
+5
-7
@@ -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
|
||||
|
||||
Reference in new issue
Block a user