Search in sources :

Example 1 with RailcraftModule

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);
}
Also used : RailcraftModule(mods.railcraft.api.core.RailcraftModule) IRailcraftModule(mods.railcraft.api.core.IRailcraftModule) Property(net.minecraftforge.common.config.Property)

Example 2 with RailcraftModule

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;
}
Also used : RailcraftModule(mods.railcraft.api.core.RailcraftModule) IRailcraftModule(mods.railcraft.api.core.IRailcraftModule) IRailcraftModule(mods.railcraft.api.core.IRailcraftModule)

Example 3 with RailcraftModule

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;
}
Also used : RailcraftModule(mods.railcraft.api.core.RailcraftModule) IRailcraftModule(mods.railcraft.api.core.IRailcraftModule) IRailcraftModule(mods.railcraft.api.core.IRailcraftModule)

Aggregations

IRailcraftModule (mods.railcraft.api.core.IRailcraftModule)3 RailcraftModule (mods.railcraft.api.core.RailcraftModule)3 Property (net.minecraftforge.common.config.Property)1