/** * Iterates over an object fields searching for HLEFunction annotations and if the specified * version is greater than the required version for that HLEFunction, it will install it. * * @param hleModule * @param version */ public void installModuleWithAnnotations(HLEModule hleModule, int version) { if (installedModules.contains(hleModule)) { return; } try { for (Method method : hleModule.getClass().getMethods()) { HLEFunction hleFunction = method.getAnnotation(HLEFunction.class); if (hleFunction != null && version >= hleFunction.version()) { installFunctionWithAnnotations(hleFunction, method, hleModule); } } installedModules.add(hleModule); } catch (Exception e) { log.error("installModuleWithAnnotations", e); } }