Пример #1
0
  public void onEnable() {

    instance = this;

    if (Bukkit.getPluginManager().getPlugin("LightAntibot") == null) {
      Bukkit.shutdown();
      warn("Name of plugin changed! Shutting down server...");
      return;
    }

    ConfigurationUtils.defaultConfiguration();
    ConfigurationUtils.loadConfiguration();

    Bukkit.getPluginManager().registerEvents(new PlayerChat(), this);
    Bukkit.getPluginManager().registerEvents(new PlayerInteract(), this);
    if (bossbarCaptcha) Bukkit.getPluginManager().registerEvents(new PlayerJoin(), this);
    Bukkit.getPluginManager().registerEvents(new PlayerLogin(), this);
    if (serverPing) Bukkit.getPluginManager().registerEvents(new ServerPing(), this);

    getCommand("antibot").setExecutor(new AntiBot());

    new ThrottleTask().start();
    if (UpdateUtils.needUpdate()) UpdateUtils.doUpdate();

    info("Enabled (v" + version + ").");

    MetricsUtils.queryMetric();
  }