use of org.terasology.module.ResolutionResult in project Terasology by MovingBlocks.
the class ModuleDownloadListGenerator method getAllModulesToDownloadFor.
Set<Module> getAllModulesToDownloadFor(Name... modulesToInstall) throws DependencyResolutionFailedException {
Version currentEngineVersion = localRegistry.getLatestModuleVersion(TerasologyConstants.ENGINE_MODULE).getVersion();
ResolutionResult resolutionResult = remoteDependencyResolver.builder().requireVersion(TerasologyConstants.ENGINE_MODULE, currentEngineVersion).requireAll(modulesToInstall).build();
return processResolutionResult(resolutionResult);
}
use of org.terasology.module.ResolutionResult in project Terasology by MovingBlocks.
the class BindsSubsystem method updateDefaultBinds.
private void updateDefaultBinds(Context passedContext, BindsConfiguration config) {
ModuleManager moduleManager = passedContext.get(ModuleManager.class);
DependencyResolver resolver = new DependencyResolver(moduleManager.getRegistry());
for (Name moduleId : moduleManager.getRegistry().getModuleIds()) {
if (moduleManager.getRegistry().getLatestModuleVersion(moduleId).isCodeModule()) {
ResolutionResult result = resolver.resolve(moduleId);
if (result.isSuccess()) {
try (ModuleEnvironment environment = moduleManager.loadEnvironment(result.getModules(), false)) {
FromModule filter = new FromModule(environment, moduleId);
Iterable<Class<?>> buttons = environment.getTypesAnnotatedWith(RegisterBindButton.class, filter);
Iterable<Class<?>> axes = environment.getTypesAnnotatedWith(RegisterRealBindAxis.class, filter);
addButtonDefaultsFor(moduleId, buttons, config);
addAxisDefaultsFor(moduleId, axes, config);
}
}
}
}
}
Aggregations