use of mods.railcraft.api.core.RailcraftModule in project Railcraft by Railcraft.
the class RailcraftModuleManager method isConfigured.
private static boolean isConfigured(Configuration config, IRailcraftModule m) {
RailcraftModule annotation = m.getClass().getAnnotation(RailcraftModule.class);
String moduleName = annotation.value().toLowerCase(Locale.ENGLISH);
// oops, remove this later
config.renameProperty(CATEGORY_MODULES, moduleName.replaceAll("[_|]", "."), moduleName);
Property prop = config.get(CATEGORY_MODULES, moduleName, true, annotation.description());
return prop.getBoolean(true);
}
use of mods.railcraft.api.core.RailcraftModule in project Railcraft by Railcraft.
the class RailcraftModuleManager method getSoftDependencies.
private static Set<Class<? extends IRailcraftModule>> getSoftDependencies(Class<? extends IRailcraftModule> moduleClass) {
RailcraftModule annotation = moduleClass.getAnnotation(RailcraftModule.class);
String[] dependencies = annotation.softDependencies();
Set<Class<? extends IRailcraftModule>> dependencyClasses = Sets.newHashSet();
dependencyClasses.addAll(Arrays.asList(annotation.softDependencyClasses()));
for (String dependency : dependencies) {
dependencyClasses.add(nameToClassMapping.get(dependency));
}
return dependencyClasses;
}
use of mods.railcraft.api.core.RailcraftModule in project Railcraft by Railcraft.
the class RailcraftModuleManager method getDependencies.
private static Set<Class<? extends IRailcraftModule>> getDependencies(Class<? extends IRailcraftModule> moduleClass) {
RailcraftModule annotation = moduleClass.getAnnotation(RailcraftModule.class);
String[] dependencies = annotation.dependencies();
Set<Class<? extends IRailcraftModule>> dependencyClasses = Sets.newHashSet();
dependencyClasses.addAll(Arrays.asList(annotation.dependencyClasses()));
for (String dependency : dependencies) {
dependencyClasses.add(nameToClassMapping.get(dependency));
}
return dependencyClasses;
}
Aggregations