Search in sources :

Example 1 with LoadPrefabs

use of org.terasology.engine.modes.loadProcesses.LoadPrefabs in project Terasology by MovingBlocks.

the class HeadlessEnvironment method loadPrefabs.

@Override
protected void loadPrefabs() {
    LoadPrefabs prefabLoadStep = new LoadPrefabs(context);
    boolean complete = false;
    prefabLoadStep.begin();
    while (!complete) {
        complete = prefabLoadStep.step();
    }
}
Also used : LoadPrefabs(org.terasology.engine.modes.loadProcesses.LoadPrefabs)

Example 2 with LoadPrefabs

use of org.terasology.engine.modes.loadProcesses.LoadPrefabs in project Terasology by MovingBlocks.

the class TerasologyTestingEnvironment method setup.

@Before
public void setup() throws Exception {
    context.put(ModuleManager.class, moduleManager);
    mockTime = mock(EngineTime.class);
    context.put(Time.class, mockTime);
    NetworkSystemImpl networkSystem = new NetworkSystemImpl(mockTime, context);
    context.put(Game.class, new Game());
    context.put(NetworkSystem.class, networkSystem);
    EntitySystemSetupUtil.addReflectionBasedLibraries(context);
    EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
    engineEntityManager = context.get(EngineEntityManager.class);
    // 'mock' added to avoid hiding a field
    BlockManager mockBlockManager = context.get(BlockManager.class);
    BiomeManager biomeManager = context.get(BiomeManager.class);
    Path savePath = PathManager.getInstance().getSavePath("world1");
    context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(), engineEntityManager, mockBlockManager, biomeManager));
    componentSystemManager = new ComponentSystemManager(context);
    context.put(ComponentSystemManager.class, componentSystemManager);
    LoadPrefabs prefabLoadStep = new LoadPrefabs(context);
    boolean complete = false;
    prefabLoadStep.begin();
    while (!complete) {
        complete = prefabLoadStep.step();
    }
    context.get(ComponentSystemManager.class).initialise();
    context.put(Console.class, new ConsoleImpl(context));
}
Also used : EngineEntityManager(org.terasology.entitySystem.entity.internal.EngineEntityManager) BiomeManager(org.terasology.world.biomes.BiomeManager) Path(java.nio.file.Path) Game(org.terasology.game.Game) LoadPrefabs(org.terasology.engine.modes.loadProcesses.LoadPrefabs) ConsoleImpl(org.terasology.logic.console.ConsoleImpl) BlockManager(org.terasology.world.block.BlockManager) EngineTime(org.terasology.engine.EngineTime) ReadWriteStorageManager(org.terasology.persistence.internal.ReadWriteStorageManager) NetworkSystemImpl(org.terasology.network.internal.NetworkSystemImpl) ComponentSystemManager(org.terasology.engine.ComponentSystemManager) Before(org.junit.Before)

Aggregations

LoadPrefabs (org.terasology.engine.modes.loadProcesses.LoadPrefabs)2 Path (java.nio.file.Path)1 Before (org.junit.Before)1 ComponentSystemManager (org.terasology.engine.ComponentSystemManager)1 EngineTime (org.terasology.engine.EngineTime)1 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)1 Game (org.terasology.game.Game)1 ConsoleImpl (org.terasology.logic.console.ConsoleImpl)1 NetworkSystemImpl (org.terasology.network.internal.NetworkSystemImpl)1 ReadWriteStorageManager (org.terasology.persistence.internal.ReadWriteStorageManager)1 BiomeManager (org.terasology.world.biomes.BiomeManager)1 BlockManager (org.terasology.world.block.BlockManager)1