use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.
the class IntegrationTestLaunch method performIntegrationTests.
private void performIntegrationTests() {
try {
// Prepare Vanilla
Bootstrap.bootStrap();
Bootstrap.validate();
// Prepare Sponge
final Lifecycle lifecycle = Launch.instance().lifecycle();
lifecycle.establishGlobalRegistries();
lifecycle.establishDataProviders();
lifecycle.callRegisterDataEvent();
this.logger().info("Performing Mixin audit");
Launch.instance().auditMixins();
} finally {
final Queue<String> capturedMessages = this.capturedMessages;
if (capturedMessages.peek() != null) {
this.logger().error("Invalid conditions were detected while applying mixins (see MixinLoggerInjector):");
String message;
while ((message = capturedMessages.poll()) != null) {
this.logger().error("- {}", message);
}
System.exit(1);
}
}
this.logger().info("Testing complete, goodbye!");
SpongeCommon.game().asyncScheduler().close();
System.exit(0);
}
use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.
the class IntegratedServerMixin_Vanilla method vanilla$runEngineStartLifecycle.
@SuppressWarnings("ConstantConditions")
@Inject(method = "initServer", at = @At("HEAD"))
private void vanilla$runEngineStartLifecycle(final CallbackInfoReturnable<Boolean> cir) {
if (!Sponge.isServerAvailable()) {
((MinecraftBridge) Minecraft.getInstance()).bridge$setTemporaryIntegratedServer((IntegratedServer) (Object) this);
}
final Lifecycle lifecycle = Launch.instance().lifecycle();
lifecycle.establishServerServices();
lifecycle.establishServerFeatures();
lifecycle.establishServerRegistries(this);
lifecycle.callStartingEngineEvent(this);
}
use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.
the class DedicatedServerMixin_Vanilla method vanilla$runEngineStartLifecycle.
@Inject(method = "initServer", at = @At("HEAD"))
private void vanilla$runEngineStartLifecycle(final CallbackInfoReturnable<Boolean> cir) {
// Save config now that registries have been initialized
ConfigHandle.setSaveSuppressed(false);
final Lifecycle lifecycle = Launch.instance().lifecycle();
lifecycle.establishServerServices();
lifecycle.establishServerFeatures();
lifecycle.establishServerRegistries(this);
lifecycle.callStartingEngineEvent(this);
}
use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.
the class MinecraftMixin_Vanilla method vanilla$establishRegistriesAndStartingEngine.
@Inject(method = "run", at = @At("HEAD"))
private void vanilla$establishRegistriesAndStartingEngine(CallbackInfo ci) {
final Lifecycle lifecycle = Launch.instance().lifecycle();
lifecycle.establishGlobalRegistries();
lifecycle.establishDataProviders();
lifecycle.callRegisterDataEvent();
lifecycle.establishClientRegistries(this);
lifecycle.callStartingEngineEvent(this);
}
use of org.spongepowered.common.launch.Lifecycle in project SpongeCommon by SpongePowered.
the class SpongeForge method onServerStarted.
@SubscribeEvent
public void onServerStarted(final FMLServerStartedEvent event) {
final Lifecycle lifecycle = Launch.instance().lifecycle();
lifecycle.callStartedEngineEvent((Server) event.getServer());
}
Aggregations