Resident plate lookups

- Loaded-plate probes use Mantle.getLoadedRegion instead of the region map
This commit is contained in:
Brian Neumann-Fopiano
2026-09-28 13:51:05 -04:00
parent 2930ca40fb
commit 53b36fe197
4 changed files with 4 additions and 5 deletions
@@ -15,7 +15,7 @@ public final class HydrologyCaveStorage {
}
int chunkX = x >> 4;
int chunkZ = z >> 4;
TectonicPlate<Matter> plate = mantle.getLoadedRegions().get(Mantle.key(chunkX >> 5, chunkZ >> 5));
TectonicPlate<Matter> plate = mantle.getLoadedRegion(chunkX >> 5, chunkZ >> 5);
if (plate == null || plate.isClosed()) {
return null;
}
@@ -579,7 +579,7 @@ public class IrisCarveModifier extends EngineAssignedModifier<NativeBlockState>
}
private MantleChunk<Matter> existingMantleChunk(Mantle<Matter> mantle, int chunkX, int chunkZ) {
TectonicPlate<Matter> plate = mantle.getLoadedRegions().get(Mantle.key(chunkX >> 5, chunkZ >> 5));
TectonicPlate<Matter> plate = mantle.getLoadedRegion(chunkX >> 5, chunkZ >> 5);
if (plate == null || plate.isClosed()) {
return null;
}
@@ -557,7 +557,7 @@ public final class GenerationHistoryRuntimeRouter implements AutoCloseable {
Mantle<Matter> mantle = access.mantle();
MantleChunk<Matter> anchor = mantle.getChunk(regionX << 5, regionZ << 5).use();
try {
TectonicPlate<Matter> plate = mantle.getLoadedRegions().get(Mantle.key(regionX, regionZ));
TectonicPlate<Matter> plate = mantle.getLoadedRegion(regionX, regionZ);
HashMap<Long, ObjectContinuationBundle> bundles = new HashMap<>();
for (int x = 0; x < 32; x++) {
for (int z = 0; z < 32; z++) {
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.CALLS_REAL_METHODS;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.doReturn;
@@ -72,7 +71,7 @@ public class IrisCarveBoundaryFacesTest {
matter[0][0].slice(PreObjectMatterCell.class).set(0, 5, 0, PreObjectMatterCell.cavern(null));
Mantle<Matter> mantle = mock(Mantle.class, RETURNS_DEEP_STUBS);
TectonicPlate<Matter> plate = mock(TectonicPlate.class);
when(mantle.getLoadedRegions().get(anyLong())).thenReturn(plate);
when(mantle.getLoadedRegion(anyInt(), anyInt())).thenReturn(plate);
when(plate.get(31, 0)).thenReturn(chunks[1]);
when(plate.get(1, 0)).thenReturn(chunks[2]);
when(plate.get(0, 31)).thenReturn(chunks[3]);