Examples of ChunkProvider


Examples of com.khorn.terraincontrol.forge.generator.ChunkProvider

        this.hugeTaigaTree1 = new WorldGenMegaPineTree(false, false);
        this.hugeTaigaTree2 = new WorldGenMegaPineTree(false, true);
        this.jungleTree = new WorldGenMegaJungle(false, 10, 20, 3, 3);
        this.groundBush = new WorldGenShrub(3, 0);

        this.generator = new ChunkProvider(this);
    }
View Full Code Here

Examples of org.terasology.world.chunks.ChunkProvider

    @Test
    public void storeAndRestoreChunkStore() {
        Chunk chunk = new ChunkImpl(CHUNK_POS);
        chunk.setBlock(0, 0, 0, testBlock);
        ChunkProvider chunkProvider = mock(ChunkProvider.class);
        when(chunkProvider.getAllChunks()).thenReturn(Arrays.asList(chunk));
        CoreRegistry.put(ChunkProvider.class, chunkProvider);

        esm.waitForCompletionOfPreviousSaveAndStartSaving();
        esm.finishSavingAndShutdown();
View Full Code Here

Examples of org.terasology.world.chunks.ChunkProvider

    @Test
    public void chunkSurvivesStorageSaveAndRestore() throws Exception {
        Chunk chunk = new ChunkImpl(CHUNK_POS);
        chunk.setBlock(0, 0, 0, testBlock);
        chunk.setBlock(0, 4, 2, testBlock2);
        ChunkProvider chunkProvider = mock(ChunkProvider.class);
        when(chunkProvider.getAllChunks()).thenReturn(Arrays.asList(chunk));
        when(chunkProvider.getChunk(Mockito.any(Vector3i.class))).thenReturn(chunk);
        CoreRegistry.put(ChunkProvider.class, chunkProvider);
        boolean storeChunkInZips = true;

        esm.setStoreChunksInZips(storeChunkInZips);
        esm.waitForCompletionOfPreviousSaveAndStartSaving();
View Full Code Here

Examples of org.terasology.world.chunks.ChunkProvider

    @Test
    public void entitySurvivesStorageInChunkStore() throws Exception {
        Chunk chunk = new ChunkImpl(CHUNK_POS);
        chunk.setBlock(0, 0, 0, testBlock);
        ChunkProvider chunkProvider = mock(ChunkProvider.class);
        when(chunkProvider.getAllChunks()).thenReturn(Arrays.asList(chunk));
        CoreRegistry.put(ChunkProvider.class, chunkProvider);
        EntityRef entity = entityManager.create();
        int id = entity.getId();
        LocationComponent locationComponent = new LocationComponent();
        Vector3f positionInChunk = new Vector3f(chunk.getAABB().getMin());
View Full Code Here

Examples of org.terasology.world.chunks.ChunkProvider

        for (EntityRef entity: entityManager.getAllEntities()) {
            if (entity.isPersistent() && !entity.getOwner().exists()) {
                unsavedEntities.add(entity);
            }
        }
        ChunkProvider chunkProvider = CoreRegistry.get(ChunkProvider.class);
        NetworkSystem networkSystem = CoreRegistry.get(NetworkSystem.class);

        addChunksToSaveTransaction(saveTransactionBuilder, chunkProvider, unsavedEntities);
        addPlayersToSaveTransaction(saveTransactionBuilder, networkSystem, unsavedEntities);
        addGlobalStoreToSaveTransaction(saveTransactionBuilder, unsavedEntities);
View Full Code Here

Examples of org.terasology.world.chunks.ChunkProvider

        logger.info("Saving - Snapshot created: Writing phase starts");
    }


    private boolean isSavingNecessary() {
        ChunkProvider chunkProvider = CoreRegistry.get(ChunkProvider.class);
        int unloadedChunkCount = unloadedAndUnsavedChunkMap.size();
        int loadedChunkCount = chunkProvider.getAllChunks().size();
        double totalChunkCount = unloadedChunkCount + loadedChunkCount;
        double percentageUnloaded = 100.0 * (unloadedChunkCount / (double) totalChunkCount);
        if (percentageUnloaded >= config.getSystem().getMaxUnloadedChunksPercentageTillSave()) {
            return true;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.