From e770551a91a6d3d064943e20ed9bf275d6c30196 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 30 Jan 2021 14:59:49 +0100 Subject: [PATCH] Hotfix --- src/de/steamwar/misslewars/FightScoreboard.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/misslewars/FightScoreboard.java b/src/de/steamwar/misslewars/FightScoreboard.java index 768f334..b1cf406 100644 --- a/src/de/steamwar/misslewars/FightScoreboard.java +++ b/src/de/steamwar/misslewars/FightScoreboard.java @@ -24,8 +24,6 @@ import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Scoreboard; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Objects; /** @@ -37,7 +35,6 @@ class FightScoreboard { private static final Scoreboard scoreboard = Objects.requireNonNull(Bukkit.getScoreboardManager()).getMainScoreboard(); private static final Objective objective; - private static final SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); private static long startTime = 0; @@ -59,7 +56,8 @@ class FightScoreboard { if (startTime == 0) { objective.getScore("§7??:??:??").setScore(4); } else { - objective.getScore("§7" + format.format(new Date(System.currentTimeMillis() - startTime))).setScore(4); + long current_time = System.currentTimeMillis() - startTime; + objective.getScore("§7" + (current_time / 60000) + ":" + ((current_time / 1000) % 60)).setScore(4); } objective.getScore("").setScore(3); objective.getScore("§eSpieler").setScore(2);