Search in sources :

Example 1 with BlockEntityRegistry

use of org.terasology.engine.world.BlockEntityRegistry 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)

Example 2 with BlockEntityRegistry

use of org.terasology.engine.world.BlockEntityRegistry in project Terasology by MovingBlocks.

the class InitialiseSystems method step.

@Override
public boolean step() {
    EngineEntityManager entityManager = (EngineEntityManager) context.get(EntityManager.class);
    EventLibrary eventLibrary = context.get(EventLibrary.class);
    BlockEntityRegistry blockEntityRegistry = context.get(BlockEntityRegistry.class);
    context.get(NetworkSystem.class).connectToEntitySystem(entityManager, eventLibrary, blockEntityRegistry);
    ComponentSystemManager csm = context.get(ComponentSystemManager.class);
    csm.initialise();
    return true;
}
Also used : EngineEntityManager(org.terasology.engine.entitySystem.entity.internal.EngineEntityManager) EngineEntityManager(org.terasology.engine.entitySystem.entity.internal.EngineEntityManager) EntityManager(org.terasology.engine.entitySystem.entity.EntityManager) EventLibrary(org.terasology.engine.entitySystem.metadata.EventLibrary) NetworkSystem(org.terasology.engine.network.NetworkSystem) BlockEntityRegistry(org.terasology.engine.world.BlockEntityRegistry) ComponentSystemManager(org.terasology.engine.core.ComponentSystemManager)

Aggregations

EntityManager (org.terasology.engine.entitySystem.entity.EntityManager)2 BlockEntityRegistry (org.terasology.engine.world.BlockEntityRegistry)2 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ComponentSystemManager (org.terasology.engine.core.ComponentSystemManager)1 EntityRef (org.terasology.engine.entitySystem.entity.EntityRef)1 EngineEntityManager (org.terasology.engine.entitySystem.entity.internal.EngineEntityManager)1 EventLibrary (org.terasology.engine.entitySystem.metadata.EventLibrary)1 NetworkSystem (org.terasology.engine.network.NetworkSystem)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