use of org.spongepowered.api.registry.FactoryRegistry 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);
}
}
use of org.spongepowered.api.registry.FactoryRegistry in project SpongeCommon by SpongePowered.
the class CommonModuleRegistry method registerFactories.
private void registerFactories() {
final List<FactoryRegistry<?, ?>> factoryRegistries = new ArrayList<>();
factoryRegistries.add(new ResourcePackFactoryModule());
factoryRegistries.add(new TimingsFactoryModule());
try {
Field modifierField = Field.class.getDeclaredField("modifiers");
modifierField.setAccessible(true);
for (FactoryRegistry<?, ?> registry : factoryRegistries) {
RegistryHelper.setFactory(registry.getFactoryOwner(), registry.provideFactory());
registry.initialize();
}
} catch (Exception e) {
SpongeImpl.getLogger().error("Could not initialize a factory!", e);
}
}
Aggregations