Package org.terasology.engine.module

Examples of org.terasology.engine.module.ModuleManager


            gameManifest.setRegisteredBlockFamilies(serverInfo.getRegisterBlockFamilyList());
            gameManifest.setBlockIdMap(blockMap);
            gameManifest.setBiomeIdMap(biomeMap);
            gameManifest.setTime(networkSystem.getServer().getInfo().getTime());

            ModuleManager moduleManager = CoreRegistry.get(ModuleManager.class);

            Set<Module> moduleSet = Sets.newLinkedHashSet();
            for (NameVersion moduleInfo : networkSystem.getServer().getInfo().getModuleList()) {
                Module module = moduleManager.getRegistry().getModule(moduleInfo.getName(), moduleInfo.getVersion());
                if (module == null) {
                    StateMainMenu mainMenu = new StateMainMenu("Missing required module: " + moduleInfo);
                    CoreRegistry.get(GameEngine.class).changeState(mainMenu);
                    return false;
                } else {
                    logger.debug("Activating module: {}:{}", moduleInfo.getName(), moduleInfo.getVersion());
                    gameManifest.addModule(module.getId(), module.getVersion());
                    moduleSet.add(module);
                }
            }
            moduleManager.loadEnvironment(moduleSet, true);

            CoreRegistry.get(Game.class).load(gameManifest);
            ApplyModulesUtil.applyModules();

            return true;
View Full Code Here


    }

    @Override
    public boolean step() {
        componentSystemManager = CoreRegistry.get(ComponentSystemManager.class);
        ModuleManager moduleManager = CoreRegistry.get(ModuleManager.class);

        TerasologyEngine terasologyEngine = (TerasologyEngine) CoreRegistry.get(GameEngine.class);
        for (EngineSubsystem subsystem : terasologyEngine.getSubsystems()) {
            subsystem.registerSystems(componentSystemManager);
        }
        componentSystemManager.loadSystems(moduleManager.getEnvironment(), netMode);

        return true;
    }
View Full Code Here

TOP

Related Classes of org.terasology.engine.module.ModuleManager

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.