public void begin() {
   drawFlag();
   thread =
       plugin
           .getServer()
           .getScheduler()
           .scheduleSyncRepeatingTask(
               plugin,
               new CellAttackThread(this),
               TownyWarConfig.getTimeBetweenFlagColorChange(),
               TownyWarConfig.getTimeBetweenFlagColorChange());
 }
  public void cancel() {
    if (thread != -1) plugin.getServer().getScheduler().cancelTask(thread);

    destroyFlag();
  }