Search in sources :

Example 1 with TestStorageManager

use of org.terasology.fixtures.TestStorageManager in project Terasology by MovingBlocks.

the class LocalChunkProviderTest method setUp.

@BeforeEach
public void setUp() {
    entityManager = mock(EntityManager.class);
    blockAtBlockManager = new Block();
    blockAtBlockManager.setId((short) 1);
    blockAtBlockManager.setUri(BlockManager.AIR_ID);
    blockAtBlockManager.setEntity(mock(EntityRef.class));
    blockManager = new TestBlockManager(blockAtBlockManager);
    extraDataManager = new ExtraBlockDataManager();
    blockEntityRegistry = mock(BlockEntityRegistry.class);
    worldEntity = mock(EntityRef.class);
    chunkCache = Maps.newConcurrentMap();
    storageManager = new TestStorageManager();
    generator = new TestWorldGenerator(blockManager);
    chunkProvider = new LocalChunkProvider(storageManager, entityManager, generator, blockManager, extraDataManager, chunkCache);
    chunkProvider.setBlockEntityRegistry(blockEntityRegistry);
    chunkProvider.setWorldEntity(worldEntity);
    // workaround. initialize loading pipeline
    chunkProvider.setRelevanceSystem(new RelevanceSystem(chunkProvider));
}
Also used : EntityManager(org.terasology.engine.entitySystem.entity.EntityManager) TestStorageManager(org.terasology.fixtures.TestStorageManager) TestBlockManager(org.terasology.fixtures.TestBlockManager) Block(org.terasology.engine.world.block.Block) BlockEntityRegistry(org.terasology.engine.world.BlockEntityRegistry) TestWorldGenerator(org.terasology.fixtures.TestWorldGenerator) ExtraBlockDataManager(org.terasology.engine.world.chunks.blockdata.ExtraBlockDataManager) EntityRef(org.terasology.engine.entitySystem.entity.EntityRef) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 EntityManager (org.terasology.engine.entitySystem.entity.EntityManager)1 EntityRef (org.terasology.engine.entitySystem.entity.EntityRef)1 BlockEntityRegistry (org.terasology.engine.world.BlockEntityRegistry)1 Block (org.terasology.engine.world.block.Block)1 ExtraBlockDataManager (org.terasology.engine.world.chunks.blockdata.ExtraBlockDataManager)1 TestBlockManager (org.terasology.fixtures.TestBlockManager)1 TestStorageManager (org.terasology.fixtures.TestStorageManager)1 TestWorldGenerator (org.terasology.fixtures.TestWorldGenerator)1