Usages of

org.spongepowered.api.event.game.state.GamePreInitializationEvent.getState()
/** * Pre Initialization tasks. * * @param event The {@link GamePreInitializationEvent}. */ @Listener public void onPreInit(GamePreInitializationEvent event) { logger.info("Starting " + PluginInfo.ID); try { getLogger().debug("Attempting to load internal messages."); final Throwable[] ex = new Throwable[0]; injector = injector.createChildInjector(binder -> binder.bind(InternalMessages.class).toProvider(() -> { try { InternalMessages tmp = new InternalMessages(container); PluginStatus.setInternalMessages(true); return tmp; } catch (Exception e1) { PluginStatus.setInternalMessages(false); PluginStatus.setErrored(true); ex[0] = e1; return null; } })); if (PluginStatus.isErrored()) { throw new RuntimeException(ex[0]); } internalMessages = injector.getProvider(InternalMessages.class).get(); // We already confirmed that internalMessages is not null assert internalMessages != null; getLogger().debug(internalMessages.getLog("internalmessages.load.success")); getLogger().info(internalMessages.getLog("plugin.phase.enter"), event.getState()); } catch (Exception e) { PluginStatus.setErrored(true); PluginStatus.checkForError(this, e); } if (!PluginStatus.isErrored()) { getLogger().info(internalMessages.getLog("plugin.phase.exit"), event.getState()); } }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes