use of org.terasology.engine.module.ModuleManagerImpl in project Terasology by MovingBlocks.
the class ModuleManagerFactory method create.
public static ModuleManager create() throws Exception {
ModuleManager moduleManager = new ModuleManagerImpl("");
try (Reader reader = new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("/module.txt"), TerasologyConstants.CHARSET)) {
ModuleMetadata metadata = new ModuleMetadataReader().read(reader);
moduleManager.getRegistry().add(ClasspathModule.create(metadata, ModuleManagerFactory.class));
}
moduleManager.loadEnvironment(Sets.newHashSet(moduleManager.getRegistry().getLatestModuleVersion(new Name("engine"))), true);
return moduleManager;
}
use of org.terasology.engine.module.ModuleManagerImpl in project Terasology by MovingBlocks.
the class TerasologyEngine method initManagers.
private void initManagers() {
changeStatus(TerasologyEngineStatus.INITIALIZING_MODULE_MANAGER);
ModuleManager moduleManager = new ModuleManagerImpl(rootContext.get(Config.class));
rootContext.put(ModuleManager.class, moduleManager);
changeStatus(TerasologyEngineStatus.INITIALIZING_LOWLEVEL_OBJECT_MANIPULATION);
ReflectFactory reflectFactory = new ReflectionReflectFactory();
rootContext.put(ReflectFactory.class, reflectFactory);
CopyStrategyLibrary copyStrategyLibrary = new CopyStrategyLibrary(reflectFactory);
rootContext.put(CopyStrategyLibrary.class, copyStrategyLibrary);
rootContext.put(TypeSerializationLibrary.class, new TypeSerializationLibrary(reflectFactory, copyStrategyLibrary));
changeStatus(TerasologyEngineStatus.INITIALIZING_ASSET_TYPES);
assetTypeManager = new ModuleAwareAssetTypeManager();
rootContext.put(ModuleAwareAssetTypeManager.class, assetTypeManager);
rootContext.put(AssetManager.class, assetTypeManager.getAssetManager());
}
Aggregations