示例#1
0
  public Playtimes(Autorank plugin) {
    this.plugin = plugin;

    INTERVAL_MINUTES = plugin.getAdvancedConfig().getInt("interval check", 5);
    plugin.getLogger().info("Interval check every " + INTERVAL_MINUTES + " minutes.");

    this.data = new SimpleYamlConfiguration(plugin, "Data.yml", null, "Data");
    this.save = new PlaytimesSave(this);
    this.update = new PlaytimesUpdate(this, plugin);

    plugin.getServer().getScheduler().runTaskTimer(plugin, save, 12000, 12000);
    plugin.getServer().getScheduler().runTaskTimer(plugin, save, 600, 600);
    plugin
        .getServer()
        .getScheduler()
        .runTaskTimer(plugin, update, INTERVAL_MINUTES * 20 * 60, INTERVAL_MINUTES * 20 * 60);
  }
示例#2
0
  public Playtimes(Autorank plugin) {
    this.plugin = plugin;
    this.scheduler = plugin.getServer().getScheduler();
    this.data = new SimpleYamlConfiguration(plugin, "Data.yml", null, "Data");
    this.save = new PlaytimesSave(this);
    this.update = new PlaytimesUpdate(this, plugin);

    sqlSetup(plugin.getAdvancedConfig());
    if (sql != null) {
      setupTable();
    }

    plugin.getServer().getScheduler().runTaskTimer(plugin, save, 12000, 12000);
    plugin.getServer().getScheduler().runTaskTimer(plugin, save, 600, 600);
    plugin
        .getServer()
        .getScheduler()
        .runTaskTimer(plugin, update, INTERVAL_MINUTES * 20 * 60, INTERVAL_MINUTES * 20 * 60);
    // plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, update, INTERVAL_MINUTES
    // * 20 * 4, INTERVAL_MINUTES * 20 * 4);

  }