use of org.terasology.persistence.ChunkStore in project Terasology by MovingBlocks.
the class StorageManagerTest method testStoreAndRestoreChunkStore.
@Test
public void testStoreAndRestoreChunkStore() {
Chunk chunk = new ChunkImpl(CHUNK_POS, blockManager, biomeManager);
chunk.setBlock(0, 0, 0, testBlock);
chunk.markReady();
ChunkProvider chunkProvider = mock(ChunkProvider.class);
when(chunkProvider.getAllChunks()).thenReturn(Arrays.asList(chunk));
CoreRegistry.put(ChunkProvider.class, chunkProvider);
esm.waitForCompletionOfPreviousSaveAndStartSaving();
esm.finishSavingAndShutdown();
ChunkStore restored = esm.loadChunkStore(CHUNK_POS);
assertNotNull(restored);
assertEquals(CHUNK_POS, restored.getChunkPosition());
assertNotNull(restored.getChunk());
assertEquals(testBlock, restored.getChunk().getBlock(0, 0, 0));
}
Aggregations