diff --git a/src/main/java/de/fanta/challenges/Timer.java b/src/main/java/de/fanta/challenges/Timer.java index 69b965c..1596a50 100644 --- a/src/main/java/de/fanta/challenges/Timer.java +++ b/src/main/java/de/fanta/challenges/Timer.java @@ -72,15 +72,16 @@ } ChatUtil.sendBrodcastMessage(ChatColor.DARK_RED + "Die Zeit ist abgelaufen und die Challenge somit fehlgeschlagen!"); ChatUtil.sendBrodcastMessage("Seed: " + ChatColor.AQUA + Bukkit.getWorlds().get(0).getSeed()); - } stopTimer(); } else { time -= (System.currentTimeMillis() - countingSinceTimestamp); + countingSinceTimestamp = System.currentTimeMillis(); sendTimerActionBar(ChatUtil.BLUE); } } else { time += (System.currentTimeMillis() - countingSinceTimestamp); + countingSinceTimestamp = System.currentTimeMillis(); sendTimerActionBar(ChatUtil.GREEN); } }, 20L, 20L); @@ -145,11 +146,11 @@ } public String formatTime(ChatColor color) { - return color + StringUtil.formatTimespan(time, " Tag/e ", "", "", "", ":", ":", false, true); + return color + StringUtil.formatTimespan((time / 1000) * 1000, " Tag/e ", "", "", "", ":", ":", false, true); } public String formatTime() { - return StringUtil.formatTimespan(time, " Tag/e ", "", "", "", ":", ":", false, true); + return StringUtil.formatTimespan((time / 1000) * 1000, " Tag/e ", "", "", "", ":", ":", false, true); } public void reverseTimer() {