Search in sources :

Example 1 with TimingsFactoryRegistryModule

use of org.lanternpowered.server.game.registry.factory.TimingsFactoryRegistryModule in project LanternServer by LanternPowered.

the class LanternGameRegistry method registerFactories.

private void registerFactories() {
    final List<FactoryRegistry<?, ?>> factoryRegistries = new ArrayList<>();
    factoryRegistries.add(new ResourcePackFactoryModule());
    factoryRegistries.add(new TimingsFactoryRegistryModule());
    try {
        for (FactoryRegistry<?, ?> registry : factoryRegistries) {
            RegistryHelper.setFactory(registry.getFactoryOwner(), registry.provideFactory());
            registry.initialize();
        }
    } catch (Exception e) {
        this.game.getLogger().error("Could not initialize a factory!", e);
    }
}
Also used : ResourcePackFactoryModule(org.lanternpowered.server.game.registry.factory.ResourcePackFactoryModule) FactoryRegistry(org.spongepowered.api.registry.FactoryRegistry) ArrayList(java.util.ArrayList) TimingsFactoryRegistryModule(org.lanternpowered.server.game.registry.factory.TimingsFactoryRegistryModule) CyclicGraphException(org.lanternpowered.server.util.graph.CyclicGraphException) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 ResourcePackFactoryModule (org.lanternpowered.server.game.registry.factory.ResourcePackFactoryModule)1 TimingsFactoryRegistryModule (org.lanternpowered.server.game.registry.factory.TimingsFactoryRegistryModule)1 CyclicGraphException (org.lanternpowered.server.util.graph.CyclicGraphException)1 FactoryRegistry (org.spongepowered.api.registry.FactoryRegistry)1