Search in sources :

Example 1 with RegistrationDependency

use of org.spongepowered.api.registry.util.RegistrationDependency in project SpongeCommon by SpongePowered.

the class SpongeGameRegistry method addToGraph.

private void addToGraph(RegistryModule module, DirectedGraph<Class<? extends RegistryModule>> graph) {
    graph.add(module.getClass());
    RegistrationDependency dependency = module.getClass().getAnnotation(RegistrationDependency.class);
    if (dependency != null) {
        for (Class<? extends RegistryModule> dependent : dependency.value()) {
            graph.addEdge(checkNotNull(module.getClass(), "Dependency class was null!"), dependent);
        }
    }
}
Also used : RegistrationDependency(org.spongepowered.api.registry.util.RegistrationDependency)

Example 2 with RegistrationDependency

use of org.spongepowered.api.registry.util.RegistrationDependency in project LanternServer by LanternPowered.

the class LanternGameRegistry method addToGraph.

private void addToGraph(RegistryModule module, DirectedGraph<Class<? extends RegistryModule>> graph) {
    graph.add(module.getClass());
    final RegistrationDependency dependency = module.getClass().getAnnotation(RegistrationDependency.class);
    if (dependency != null) {
        for (Class<? extends RegistryModule> dependent : dependency.value()) {
            graph.addEdge(checkNotNull(module.getClass(), "Dependency class was null!"), dependent);
        }
    }
}
Also used : RegistrationDependency(org.spongepowered.api.registry.util.RegistrationDependency)

Aggregations

RegistrationDependency (org.spongepowered.api.registry.util.RegistrationDependency)2