Example #1
0
  @Override
  public void onEnable() {

    pluginInstance = this;

    getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);

    this.initConfig();

    PluginDescriptionFile pluginInfo = this.getDescription();

    PluginUtil.initPlugin();

    ServerUtil.initServer();

    WorldUtil.initWorldUtil();

    WorldUtil.switchToNewWorld();

    this.initCommands();

    this.initEvents();

    getLogger()
        .log(
            Level.INFO,
            "{0} ({1}) has successfully been initialized!",
            new Object[] {pluginInfo.getName(), pluginInfo.getVersion()});
  }
Example #2
0
  @Override
  public void onDisable() {

    ServerUtil.shutdownServer();

    PluginDescriptionFile pluginInfo = this.getDescription();

    getLogger()
        .log(
            Level.INFO,
            "{0} ({1}) has successfully been disabled.",
            new Object[] {pluginInfo.getName(), pluginInfo.getVersion()});
  }