use of com.ichorpowered.guardian.event.GuardianStartingEvent in project guardian by ichorpowered.
the class GamePluginFacet method startup.
public Boolean startup() {
this.facetState = FacetState.PREPARE;
PropertyInjector propertyInjector = this.plugin.getPropertyInjector();
propertyInjector.inject("state", GuardianState.STARTING);
// STATE: STARTING
this.logger.info(ConsoleUtil.of(this.facetPrefix + "Preparing environment adaptions."));
// TODO: Environment adaptions are a future feature.
this.plugin.getSequenceTask().start();
this.plugin.getEventBus().post(new GuardianStartingEvent(this.plugin, Origin.source(this.plugin.getPluginContainer()).build()));
propertyInjector.inject("state", GuardianState.STARTED);
// STATE: STARTED
this.logger.info(ConsoleUtil.of(this.facetPrefix + "Startup complete. ({} sec)", String.valueOf((double) (System.currentTimeMillis() - this.plugin.getCoreTime()) / 1000)));
this.plugin.getEventBus().post(new GuardianStartedEvent(this.plugin, Origin.source(this.plugin.getPluginContainer()).build()));
this.facetState = FacetState.START;
return true;
}
Aggregations