Examples of DailyTimerTask


Examples of com.palmergames.bukkit.towny.tasks.DailyTimerTask

  public void newDay() {
    if (!isDailyTimerRunning())
      toggleDailyTimer(true);
    //dailyTimer.schedule(new DailyTimerTask(this), 0);
    if (getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new DailyTimerTask(this)) == -1)
      TownyMessaging.sendErrorMsg("Could not schedule newDay.");
    setChangedNotify(NEW_DAY);
  }
View Full Code Here

Examples of com.palmergames.bukkit.towny.tasks.DailyTimerTask

  public void toggleDailyTimer(boolean on) {
    if (on && !isDailyTimerRunning()) {
      long timeTillNextDay = TownyUtil.townyTime();
      TownyMessaging.sendMsg("Time until a New Day: " + TimeMgmt.formatCountdownTime(timeTillNextDay));
      dailyTask = getPlugin().getServer().getScheduler().scheduleSyncRepeatingTask(getPlugin(), new DailyTimerTask(this), MinecraftTools.convertToTicks(timeTillNextDay), MinecraftTools.convertToTicks(TownySettings.getDayInterval()));
      if (dailyTask == -1)
        TownyMessaging.sendErrorMsg("Could not schedule new day loop.");
    } else if (!on && isDailyTimerRunning()) {
      getPlugin().getServer().getScheduler().cancelTask(dailyTask);
      dailyTask = -1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.