Package org.terasology.persistence

Examples of org.terasology.persistence.StorageManager


    public void close() throws Exception {
        // it would be nice, if elements in the CoreRegistry implemented (Auto)Closeable

        // The StorageManager creates a thread pool (through TaskMaster)
        // which isn't closed automatically
        StorageManager storageManager = CoreRegistry.get(StorageManager.class);
        if (storageManager != null) {
            storageManager.finishSavingAndShutdown();
        }

        CoreRegistry.clear();

        super.close();
View Full Code Here


            return true; // We need to return true, otherwise the loading state will just call us again immediately
        }

        // Init. a new world
        EngineEntityManager entityManager = (EngineEntityManager) CoreRegistry.get(EntityManager.class);
        StorageManager storageManager = CoreRegistry.put(StorageManager.class,
                new StorageManagerInternal(CoreRegistry.get(ModuleManager.class).getEnvironment(), entityManager));
        LocalChunkProvider chunkProvider = new LocalChunkProvider(storageManager, entityManager, worldGenerator);
        CoreRegistry.get(ComponentSystemManager.class).register(new RelevanceSystem(chunkProvider), "engine:relevanceSystem");
        EntityAwareWorldProvider entityWorldProvider = new EntityAwareWorldProvider(new WorldProviderCoreImpl(worldInfo, chunkProvider));
        WorldProvider worldProvider = new WorldProviderWrapper(entityWorldProvider);
View Full Code Here

            logger.error("Entity created before load: {}", entity.toFullDescription());
        }
        if (entityCreated) {
            throw new IllegalStateException("Entity creation detected during component system initialisation, game load aborting");
        }
        StorageManager storageManager = CoreRegistry.get(StorageManager.class);
        try {
            storageManager.loadGlobalStore();
        } catch (IOException e) {
            logger.error("Failed to load global data.", e);
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of org.terasology.persistence.StorageManager

Copyright © 2018 www.massapicom. 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.