use of org.spongepowered.common.SpongeLifecycle in project SpongeCommon by SpongePowered.
the class BootstrapMixin_Forge method forge$startLifecycle.
// @formatter:on
@Inject(method = "bootStrap", at = @At("HEAD"))
private static void forge$startLifecycle(final CallbackInfo ci) {
if (BootstrapMixin_Forge.isBootstrapped) {
return;
}
final ForgeLaunch launch = Launch.instance();
final Stage stage = SpongeGuice.getInjectorStage(launch.injectionStage());
SpongeCommon.logger().debug("Creating injector in stage '{}'", stage);
final Injector bootstrapInjector = launch.createInjector();
final SpongeLifecycle lifecycle = bootstrapInjector.getInstance(SpongeLifecycle.class);
launch.setLifecycle(lifecycle);
lifecycle.establishFactories();
lifecycle.establishBuilders();
lifecycle.initTimings();
}
use of org.spongepowered.common.SpongeLifecycle in project SpongeCommon by SpongePowered.
the class VanillaBootstrap method perform.
public static void perform(final String engineName, final Runnable engineStart) {
final Stage stage = SpongeGuice.getInjectorStage(Launch.instance().injectionStage());
SpongeCommon.logger().debug("Creating injector in stage '{}'", stage);
final Injector bootstrapInjector = Launch.instance().createInjector();
final SpongeLifecycle lifecycle = bootstrapInjector.getInstance(SpongeLifecycle.class);
Launch.instance().setLifecycle(lifecycle);
lifecycle.establishFactories();
lifecycle.establishBuilders();
lifecycle.initTimings();
((VanillaPluginManager) Launch.instance().pluginManager()).loadPlugins((VanillaPluginPlatform) Launch.instance().pluginPlatform());
lifecycle.callConstructEvent();
lifecycle.callRegisterFactoryEvent();
lifecycle.callRegisterBuilderEvent();
lifecycle.callRegisterChannelEvent();
lifecycle.establishGameServices();
lifecycle.establishDataKeyListeners();
SpongePacketHandler.init((SpongeChannelManager) Sponge.channelManager());
Launch.instance().logger().info("Loading Minecraft {}, please wait...", engineName);
engineStart.run();
}
Aggregations