mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-27 06:20:02 +00:00
Merge W2H-platerace
This commit is contained in:
commit
bcb59d3584
42 files changed
+94
-86
No files matched your search
@@ -169,8 +169,7 @@ public class EngineMantleCleanupTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
doReturn(true).when(engineMantle).isCovered(7, -4);
|
||||
when(mantle.getChunk(7, -4)).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(7, -4)).thenReturn(chunk);
|
||||
doAnswer(invocation -> {
|
||||
Runnable cleanup = invocation.getArgument(1);
|
||||
cleanup.run();
|
||||
|
||||
@@ -197,7 +197,7 @@ public class EngineMantleCoverageTest {
|
||||
|
||||
assertTrue(actual.isEmpty());
|
||||
verify(fixture.mantle(), never()).hasLoadedFlag(anyInt(), anyInt(), any());
|
||||
verify(fixture.mantle(), never()).getChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).useChunk(anyInt(), anyInt());
|
||||
|
||||
when(fixture.mantle().isChunkLoaded(anyInt(), anyInt())).thenReturn(true);
|
||||
fixture.engine().cleanupChunksCoveredBy(0, 0, true,
|
||||
@@ -217,7 +217,7 @@ public class EngineMantleCoverageTest {
|
||||
|
||||
assertTrue(actual.isEmpty());
|
||||
assertTrue(fixture.cleaned().isEmpty());
|
||||
verify(fixture.mantle(), never()).getChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).useChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).hasFlag(anyInt(), anyInt(), any());
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public class EngineMantleCoverageTest {
|
||||
|
||||
assertTrue(actual.isEmpty());
|
||||
verify(fixture.mantle(), never()).withLoadedChunk(anyInt(), anyInt(), any());
|
||||
verify(fixture.mantle(), never()).getChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).useChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).hasFlag(anyInt(), anyInt(), any());
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ public class EngineMantleCoverageTest {
|
||||
});
|
||||
}
|
||||
assertEquals(List.of(new Chunk(0, 0)), actual);
|
||||
verify(fixture.mantle(), never()).getChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).useChunk(anyInt(), anyInt());
|
||||
verify(fixture.mantle(), never()).hasFlag(anyInt(), anyInt(), any());
|
||||
}
|
||||
|
||||
|
||||
+3
-6
@@ -112,10 +112,8 @@ public class FloatingObjectPlacementTransactionTest {
|
||||
when(engine.getHeight()).thenReturn(128);
|
||||
when(engine.getMantle()).thenReturn(engineMantle);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(left);
|
||||
when(mantle.getChunk(1, 0)).thenReturn(right);
|
||||
when(left.use()).thenReturn(left);
|
||||
when(right.use()).thenReturn(right);
|
||||
when(mantle.useChunk(0, 0)).thenReturn(left);
|
||||
when(mantle.useChunk(1, 0)).thenReturn(right);
|
||||
when(left.getOrCreate(0)).thenReturn(leftSection);
|
||||
when(right.getOrCreate(0)).thenReturn(rightSection);
|
||||
NativeBlockState state = mock(NativeBlockState.class);
|
||||
@@ -146,8 +144,7 @@ public class FloatingObjectPlacementTransactionTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(engine.getMantle()).thenReturn(engineMantle);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.isFlagged(MantleFlag.REAL)).thenReturn(true);
|
||||
when(placer.getEngine()).thenReturn(engine);
|
||||
when(placer.canWriteObjectBlock(anyInt(), anyInt(), anyInt())).thenAnswer(invocation -> {
|
||||
|
||||
+1
@@ -67,6 +67,7 @@ public class MantleCarvingComponentBoundaryRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
|
||||
+1
@@ -319,6 +319,7 @@ public class MantleObjectComponentBoundaryRadiusTest {
|
||||
when(mantle.getWorldHeight()).thenReturn(64);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
|
||||
@@ -68,6 +68,7 @@ public class MantleWriterOverlayTest {
|
||||
when(engine.getDimension()).thenReturn(dimension);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(0, 0)).thenAnswer(call -> chunk.use());
|
||||
when(chunk.getOrCreate(0)).thenReturn(matter);
|
||||
when(chunk.exists(0)).thenReturn(true);
|
||||
when(chunk.get(0)).thenReturn(matter);
|
||||
|
||||
+1
@@ -82,6 +82,7 @@ public class MantleWriterPreObjectJournalTest {
|
||||
when(mantle.getWorldHeight()).thenReturn(32);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(0, 0)).thenAnswer(call -> chunk.use());
|
||||
when(chunk.exists(0)).thenReturn(true);
|
||||
when(chunk.getOrCreate(0)).thenReturn(matter);
|
||||
when(chunk.get(0)).thenReturn(matter);
|
||||
|
||||
+5
@@ -39,6 +39,7 @@ public class MatterGeneratorCarvePassRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
@@ -76,6 +77,7 @@ public class MatterGeneratorCarvePassRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
@@ -107,6 +109,7 @@ public class MatterGeneratorCarvePassRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
@@ -144,6 +147,7 @@ public class MatterGeneratorCarvePassRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
@@ -184,6 +188,7 @@ public class MatterGeneratorCarvePassRadiusTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk.use());
|
||||
doAnswer(invocation -> {
|
||||
Runnable task = invocation.getArgument(1);
|
||||
task.run();
|
||||
|
||||
+2
@@ -776,6 +776,8 @@ public class MatterGeneratorConcurrencyTest {
|
||||
long key = (((long) chunkX) << 32) ^ (chunkZ & 0xffffffffL);
|
||||
return chunks.computeIfAbsent(key, ignored -> lockingChunks ? lockingChunk() : chunk());
|
||||
});
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(invocation ->
|
||||
mantle.getChunk(invocation.getArgument(0), invocation.getArgument(1)).use());
|
||||
context = mock(ChunkContext.class);
|
||||
when(context.getGenerationSessionId()).thenReturn(91L);
|
||||
}
|
||||
|
||||
@@ -246,10 +246,8 @@ public class ObjectContinuationTest {
|
||||
Mantle<Matter> mantle = mock(Mantle.class);
|
||||
MantleChunk<Matter> saved = mock(MantleChunk.class);
|
||||
MantleChunk<Matter> future = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(saved);
|
||||
when(mantle.getChunk(1, 0)).thenReturn(future);
|
||||
when(saved.use()).thenReturn(saved);
|
||||
when(future.use()).thenReturn(future);
|
||||
when(mantle.useChunk(0, 0)).thenReturn(saved);
|
||||
when(mantle.useChunk(1, 0)).thenReturn(future);
|
||||
when(saved.isFlagged(MantleFlag.REAL)).thenReturn(true);
|
||||
Matter section = new IrisMatter(16, 16, 16);
|
||||
when(future.getOrCreate(0)).thenReturn(section);
|
||||
|
||||
+1
@@ -634,6 +634,7 @@ public class ObjectDestinationTransactionTest {
|
||||
when(mantle.getWorldHeight()).thenReturn(16);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(0, 0)).thenAnswer(call -> chunk.use());
|
||||
when(chunk.exists(0)).thenReturn(true);
|
||||
when(chunk.getOrCreate(0)).thenReturn(matter);
|
||||
when(chunk.get(0)).thenReturn(matter);
|
||||
|
||||
@@ -80,6 +80,7 @@ public class TerrainPlacementQueryTest {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(0, 0)).thenAnswer(call -> chunk.use());
|
||||
when(chunk.exists(0)).thenReturn(true);
|
||||
matter = new IrisMatter(16, 16, 16);
|
||||
when(chunk.get(0)).thenReturn(matter);
|
||||
|
||||
+1
@@ -308,6 +308,7 @@ public class DimensionTerrain3DCompositionTest {
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getChunk(0, 0)).thenReturn(mantleChunk);
|
||||
when(mantleChunk.use()).thenReturn(mantleChunk);
|
||||
when(mantle.useChunk(0, 0)).thenAnswer(call -> mantleChunk.use());
|
||||
when(context.getDimensionStackLayout(0, 0)).thenReturn(layout);
|
||||
Hunk<NativeBlockState> output = Hunk.newArrayHunk(1, height, 1);
|
||||
for (int y = 0; y < height; y++) {
|
||||
|
||||
@@ -106,11 +106,10 @@ public class EngineBiomeColumnTest {
|
||||
when(mantle.hasTectonicPlate(anyInt(), anyInt())).thenReturn(true);
|
||||
when(mantle.get(anyInt(), anyInt(), anyInt(), eq(MatterCavern.class))).thenAnswer(call ->
|
||||
cavern(salt, call.getArgument(0), call.getArgument(1), call.getArgument(2)));
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenAnswer(call -> {
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> {
|
||||
int chunkX = call.getArgument(0);
|
||||
int chunkZ = call.getArgument(1);
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(chunk.get(anyInt(), anyInt(), anyInt(), eq(MatterCavern.class))).thenAnswer(read -> cavern(salt,
|
||||
chunkX * 16 + (int) read.getArgument(0), read.getArgument(1), chunkZ * 16 + (int) read.getArgument(2)));
|
||||
return chunk;
|
||||
|
||||
+1
-2
@@ -184,8 +184,7 @@ public class IrisCarveWallPaletteScopeTest {
|
||||
chunk = mock(MantleChunk.class);
|
||||
EngineMantle engineMantle = mock(EngineMantle.class);
|
||||
doReturn(mantle).when(engineMantle).getMantle();
|
||||
doReturn(chunk).when(mantle).getChunk(-2, 3);
|
||||
doReturn(chunk).when(chunk).use();
|
||||
doReturn(chunk).when(mantle).useChunk(-2, 3);
|
||||
IrisMatterSupport.ensureRegistered();
|
||||
Matter section = new IrisMatter(16, 16, 16);
|
||||
for (int coordinate : new int[]{4, 8, 12}) {
|
||||
|
||||
+2
-1
@@ -58,7 +58,7 @@ public class WorldChunkMaintenanceRoutingTest {
|
||||
public void materializesTheSavedOwnerAndKeepsSpawningAfterCompletion() throws Exception {
|
||||
try (Fixture fixture = new Fixture()) {
|
||||
fixture.schedule();
|
||||
verify(fixture.currentMantle, never()).getChunk(2, -1);
|
||||
verify(fixture.currentMantle, never()).useChunk(2, -1);
|
||||
fixture.prepare();
|
||||
|
||||
verify(fixture.savedChunk).use();
|
||||
@@ -285,6 +285,7 @@ public class WorldChunkMaintenanceRoutingTest {
|
||||
when(saved.mantle()).thenReturn(savedMantle);
|
||||
when(savedMantle.getChunk(2, -1)).thenReturn(savedChunk);
|
||||
when(savedChunk.use()).thenReturn(savedChunk);
|
||||
when(savedMantle.useChunk(2, -1)).thenAnswer(invocation -> savedMantle.getChunk(2, -1).use());
|
||||
when(savedMantle.isChunkLoaded(2, -1)).thenReturn(true);
|
||||
when(savedMantle.hasFlag(2, -1, MantleFlag.ETCHED)).thenAnswer(invocation -> etched.get());
|
||||
when(router.openSavedChunkMantle(2, -1)).thenReturn(saved);
|
||||
|
||||
+1
-2
@@ -177,8 +177,7 @@ public class IrisDepositModifierContextTest {
|
||||
.thenReturn(new KList<>(biomeDeposit));
|
||||
chunk = mock(MantleChunk.class);
|
||||
Mantle<Matter> mantle = engine.getMantle().getMantle();
|
||||
doReturn(chunk).when(mantle).getChunk(2, -3);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
doReturn(chunk).when(mantle).useChunk(2, -3);
|
||||
if (engine instanceof IrisEngine irisEngine) {
|
||||
when(irisEngine.hasGenerationRuntimeScope()).thenReturn(scoped);
|
||||
when(irisEngine.captureGenerationRuntimeBinding()).thenReturn(binding);
|
||||
|
||||
+1
-2
@@ -296,8 +296,7 @@ public class IrisDepositModifierOrderingTest {
|
||||
when(context.getGenerationSessionId()).thenReturn(11L);
|
||||
chunk = mock(MantleChunk.class);
|
||||
Mantle<Matter> mantle = engine.getMantle().getMantle();
|
||||
doReturn(chunk).when(mantle).getChunk(0, 0);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
doReturn(chunk).when(mantle).useChunk(0, 0);
|
||||
MultiBurst pool = mock(MultiBurst.class);
|
||||
BurstExecutor burst = new BurstExecutor(executor, 3);
|
||||
burst.setMulticore(parallel);
|
||||
|
||||
+1
-2
@@ -193,8 +193,7 @@ public class IrisDepositModifierParityTest {
|
||||
when(context.getRegion().get(anyInt(), anyInt())).thenReturn(region);
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
Mantle<Matter> mantle = engine.getMantle().getMantle();
|
||||
doReturn(chunk).when(mantle).getChunk(-3, 5);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
doReturn(chunk).when(mantle).useChunk(-3, 5);
|
||||
MatterCavern cavern = new MatterCavern(true, "allowed", (byte) 0);
|
||||
when(chunk.get(anyInt(), anyInt(), anyInt(), any())).thenAnswer(invocation -> {
|
||||
int x = invocation.getArgument(0);
|
||||
|
||||
@@ -81,18 +81,18 @@ public class IrisNaturalCaveScanTest {
|
||||
Fixture fixture = new Fixture();
|
||||
ChunkContext context = mock(ChunkContext.class);
|
||||
doReturn(CaveTerrainSnapshot.capture(fixture.chunk, -2, 3)).when(context).getCaveTerrain();
|
||||
clearInvocations(fixture.chunk);
|
||||
clearInvocations(fixture.mantle);
|
||||
fixture.modifier.decorateNaturalCaves(-32, 48, fixture.output(3, 2), context);
|
||||
verify(fixture.chunk, never()).use();
|
||||
verify(fixture.mantle, never()).useChunk(anyInt(), anyInt());
|
||||
verify(context).setCaveTerrain(null);
|
||||
assertFalse(fixture.calls.isEmpty());
|
||||
|
||||
Fixture other = new Fixture();
|
||||
ChunkContext stale = mock(ChunkContext.class);
|
||||
doReturn(CaveTerrainSnapshot.capture(other.chunk, 5, 5)).when(stale).getCaveTerrain();
|
||||
clearInvocations(other.chunk);
|
||||
clearInvocations(other.mantle);
|
||||
other.modifier.decorateNaturalCaves(-32, 48, other.output(3, 2), stale);
|
||||
verify(other.chunk).use();
|
||||
verify(other.mantle).useChunk(-2, 3);
|
||||
assertEquals(fixture.calls, other.calls);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class IrisNaturalCaveScanTest {
|
||||
assertEquals(expectedWrites, writes);
|
||||
assertEquals(expectedMarkers, fixture.markers);
|
||||
assertTrue("fixture must exercise marker writes", !expectedMarkers.isEmpty());
|
||||
verify(fixture.chunk).use();
|
||||
verify(fixture.mantle).useChunk(-2, 3);
|
||||
verify(fixture.chunk).release();
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@ public class IrisNaturalCaveScanTest {
|
||||
private final NativeBlockState floor = block("minecraft:moss_block", true);
|
||||
private final NativeBlockState ceiling = block("minecraft:calcite", true);
|
||||
private final IrisCarveModifier modifier = mock(IrisCarveModifier.class, CALLS_REAL_METHODS);
|
||||
private final Mantle<Matter> mantle;
|
||||
private final MantleChunk<Matter> chunk;
|
||||
private final List<String> calls = new ArrayList<>();
|
||||
private final List<String> markers = new ArrayList<>();
|
||||
@@ -248,7 +249,7 @@ public class IrisNaturalCaveScanTest {
|
||||
private Fixture(boolean buildAboveTop) throws Exception {
|
||||
Engine engine = mock(Engine.class);
|
||||
EngineMantle engineMantle = mock(EngineMantle.class);
|
||||
Mantle<Matter> mantle = mock(Mantle.class);
|
||||
mantle = mock(Mantle.class);
|
||||
chunk = mock(MantleChunk.class);
|
||||
doReturn(engine).when(modifier).getEngine();
|
||||
doReturn(mock(IrisComplex.class)).when(modifier).getComplex();
|
||||
@@ -256,8 +257,7 @@ public class IrisNaturalCaveScanTest {
|
||||
doReturn(new SeedManager(1337L)).when(engine).getSeedManager();
|
||||
doReturn(engineMantle).when(engine).getMantle();
|
||||
doReturn(mantle).when(engineMantle).getMantle();
|
||||
doReturn(chunk).when(mantle).getChunk(-2, 3);
|
||||
doReturn(chunk).when(chunk).use();
|
||||
doReturn(chunk).when(mantle).useChunk(-2, 3);
|
||||
doAnswer(call -> {
|
||||
markers.add(call.getArgument(0) + ":" + call.getArgument(1) + ":" + call.getArgument(2) + ":" + call.getArgument(3));
|
||||
return null;
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class EngineBukkitOpsDeferredMaterializationTest {
|
||||
Block block = mock(Block.class);
|
||||
when(chunk.getBlock(1, 2, 3)).thenReturn(block);
|
||||
when(saved.isLoaded(chunk)).thenReturn(true);
|
||||
when(saved.getChunk(chunk)).thenReturn(stored);
|
||||
when(saved.useChunk(chunk)).thenAnswer(invocation -> stored.use());
|
||||
ExternalDataSVC provider = mock(ExternalDataSVC.class);
|
||||
|
||||
try (MockedStatic<J> scheduling = mockStatic(J.class);
|
||||
|
||||
+5
-6
@@ -456,9 +456,9 @@ public class NativeStructureOwnershipStoreTest {
|
||||
currentRuntime.set(12);
|
||||
|
||||
assertTrue(storage.flush());
|
||||
verify(mantleA.mantle(), times(2)).getChunk(4, -5);
|
||||
verify(mantleA.mantle(), times(2)).useChunk(4, -5);
|
||||
verify(mantleA.mantle()).saveIdleTectonicPlates(any());
|
||||
verify(mantleB.mantle(), never()).getChunk(anyInt(), anyInt());
|
||||
verify(mantleB.mantle(), never()).useChunk(anyInt(), anyInt());
|
||||
verify(mantleB.mantle(), never()).saveIdleTectonicPlates(any());
|
||||
storage.close();
|
||||
}
|
||||
@@ -491,9 +491,9 @@ public class NativeStructureOwnershipStoreTest {
|
||||
storage.write(NativeStructureOwnershipStore.pack(9, -10), recordB);
|
||||
|
||||
assertTrue(storage.flush());
|
||||
verify(mantleA.mantle(), times(2)).getChunk(-7, 8);
|
||||
verify(mantleA.mantle(), times(2)).useChunk(-7, 8);
|
||||
verify(mantleA.mantle()).saveIdleTectonicPlates(any());
|
||||
verify(mantleB.mantle(), times(2)).getChunk(9, -10);
|
||||
verify(mantleB.mantle(), times(2)).useChunk(9, -10);
|
||||
verify(mantleB.mantle()).saveIdleTectonicPlates(any());
|
||||
storage.close();
|
||||
}
|
||||
@@ -519,8 +519,7 @@ public class NativeStructureOwnershipStoreTest {
|
||||
Matter section = mock(Matter.class);
|
||||
MatterSlice<NativeStructureOwnershipBundle> slice = mock(MatterSlice.class);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.getOrCreate(0)).thenReturn(section);
|
||||
when(section.<NativeStructureOwnershipBundle>slice(
|
||||
NativeStructureOwnershipBundle.class)).thenReturn(slice);
|
||||
|
||||
@@ -187,9 +187,8 @@ public class IrisStaticObjectLayerTest {
|
||||
MatterSlice<TileWrapper> tiles = mock(MatterSlice.class);
|
||||
when(engine.getMantle()).thenReturn(engineMantle);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenReturn(chunk);
|
||||
when(chunk.getOrCreate(anyInt())).thenReturn(section);
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(section.getSlice(TileWrapper.class)).thenReturn(tiles);
|
||||
when(chunk.isFlagged(MantleFlag.REAL)).thenReturn(true);
|
||||
Hunk<NativeBlockState> left = Hunk.newArrayHunk(16, 384, 16);
|
||||
@@ -402,7 +401,7 @@ public class IrisStaticObjectLayerTest {
|
||||
when(engine.getMantle()).thenReturn(engineMantle);
|
||||
when(engineMantle.getMantle()).thenReturn(mantle);
|
||||
when(mantle.getWorldHeight()).thenReturn(384);
|
||||
when(mantle.getChunk(anyInt(), anyInt())).thenAnswer(call -> chunk(call.getArgument(0), call.getArgument(1)));
|
||||
when(mantle.useChunk(anyInt(), anyInt())).thenAnswer(call -> chunk(call.getArgument(0), call.getArgument(1)));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -410,7 +409,6 @@ public class IrisStaticObjectLayerTest {
|
||||
return chunks.computeIfAbsent(new ObjectContinuationBundle.ChunkPosition(x, z), key -> {
|
||||
MantleChunk<Matter> chunk = mock(MantleChunk.class);
|
||||
Map<Integer, Matter> sections = new HashMap<>();
|
||||
when(chunk.use()).thenReturn(chunk);
|
||||
when(chunk.get(anyInt())).thenAnswer(call -> sections.get((int) call.getArgument(0)));
|
||||
when(chunk.getOrCreate(anyInt())).thenAnswer(call -> sections.computeIfAbsent(call.getArgument(0),
|
||||
section -> new IrisMatter(16, 16, 16)));
|
||||
|
||||
Reference in new issue
Block a user