Search in sources :

Example 11 with Lifecycle

use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.

the class SpongeForge method onServerStoppedEvent.

@SubscribeEvent
public void onServerStoppedEvent(final FMLServerStoppedEvent event) {
    final Lifecycle lifecycle = Launch.instance().lifecycle();
    lifecycle.callStoppingEngineEvent((Server) event.getServer());
}
Also used : Lifecycle(org.spongepowered.common.launch.Lifecycle) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Example 12 with Lifecycle

use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.

the class DedicatedServerMixin_Vanilla method vanilla$callStartedEngineAndLoadedGame.

@Inject(method = "initServer", at = @At("RETURN"))
private void vanilla$callStartedEngineAndLoadedGame(final CallbackInfoReturnable<Boolean> cir) {
    final Lifecycle lifecycle = Launch.instance().lifecycle();
    lifecycle.callStartedEngineEvent(this);
    lifecycle.callLoadedGameEvent();
}
Also used : Lifecycle(org.spongepowered.common.launch.Lifecycle) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

Lifecycle (org.spongepowered.common.launch.Lifecycle)12 Inject (org.spongepowered.asm.mixin.injection.Inject)5 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)3 Path (java.nio.file.Path)1 Client (org.spongepowered.api.Client)1 Redirect (org.spongepowered.asm.mixin.injection.Redirect)1 MinecraftBridge (org.spongepowered.common.bridge.client.MinecraftBridge)1