Esempio n. 1
0
 public void onReload() {
   viewMan.clearAll();
   HandlerList.unregisterAll(viewMan);
   configMan.getConfig("kits.yml").reloadConfig();
   kitMan = new KitManager(this);
   viewMan = new ViewManager(this);
   getServer().getPluginManager().registerEvents(viewMan, this);
 }
Esempio n. 2
0
  @Override
  public void onEnable() {
    // plugin = this;

    getLogger().info("Created by Jcdesimp!");

    //// CONFIG FILE MANAGEMENT ///

    configMan = new ConfigManager(this);
    configMan.addConfig("config.yml");
    configMan.addConfig("kits.yml");

    ////////////////////////////////

    kitMan = new KitManager(this);
    viewMan = new ViewManager(this);
    vHandler = new VaultHandler(this);

    getServer().getPluginManager().registerEvents(viewMan, this);

    // Database creation, configuration, and maintenance.
    setupDatabase();
    // getLogger().info(getDescription().getName() + ": Created by Jcdesimp");
    getLogger().info("Created by Jcdesimp!");

    // Plugin Metrics
    try {
      Metrics metrics = new Metrics(this);
      metrics.start();
    } catch (IOException e) {
      // Failed to submit the stats :-(
    }

    // Command Executor
    getCommand("canvaskits").setExecutor(new CanvasKitsCommandExecutor(this));
    getCommand("kits").setExecutor(new KitsCommandExecutor(this));

    verifyDatabaseVersion();
  }