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;