use of org.terasology.module.ModuleMetadataReader 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;
}
Aggregations