Exemple #1
0
  public void preInit() {
    try {
      SpongeImpl.getLogger().info("Loading Sponge...");

      Path gameDir = SpongeImpl.getGameDirectory();
      Path pluginsDir = SpongeImpl.getPluginsDirectory();
      Files.createDirectories(pluginsDir);

      SpongeImpl.getRegistry().preRegistryInit();
      // TODO: Init services
      // TODO: Init commands
      SpongeImpl.getRegistry().preInit();

      this.game.getEventManager().registerListeners(this, this);
      this.game.getEventManager().registerListeners(this, this.game.getRegistry());

      SpongeImpl.getLogger().info("Loading plugins...");
      ((LanternPluginManager) this.game.getPluginManager()).loadPlugins();
      postState(GameConstructionEvent.class, GameState.CONSTRUCTION);
      SpongeImpl.getLogger().info("Initializing plugins...");
      postState(GamePreInitializationEvent.class, GameState.PRE_INITIALIZATION);

      // TODO: register permission calculator
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }
Exemple #2
0
  public void init() {
    SpongeImpl.getRegistry().init();
    postState(GameInitializationEvent.class, GameState.INITIALIZATION);

    // TODO: Register permissions

    SpongeImpl.getRegistry().postInit();

    // TODO: Data complete registration

    postState(GamePostInitializationEvent.class, GameState.POST_INITIALIZATION);

    SpongeImpl.getLogger().info("Successfully loaded and initialized plugins.");

    postState(GameLoadCompleteEvent.class, GameState.LOAD_COMPLETE);
  }