From 83b1f9c6fcde37fba31c36a9065bbd30fdd56ebd Mon Sep 17 00:00:00 2001 From: jojo Date: Sat, 30 Jan 2021 15:03:44 +0100 Subject: [PATCH] Hotfix FightScoreboard --- src/de/steamwar/misslewars/FightScoreboard.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/misslewars/FightScoreboard.java b/src/de/steamwar/misslewars/FightScoreboard.java index b1cf406..1dbea54 100644 --- a/src/de/steamwar/misslewars/FightScoreboard.java +++ b/src/de/steamwar/misslewars/FightScoreboard.java @@ -24,6 +24,8 @@ 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; /** @@ -35,6 +37,7 @@ 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; @@ -57,7 +60,7 @@ class FightScoreboard { objective.getScore("§7??:??:??").setScore(4); } else { long current_time = System.currentTimeMillis() - startTime; - objective.getScore("§7" + (current_time / 60000) + ":" + ((current_time / 1000) % 60)).setScore(4); + objective.getScore(String.format("§7%02d:%02d", current_time / 60000, (current_time / 1000) % 60)).setScore(4); } objective.getScore("").setScore(3); objective.getScore("§eSpieler").setScore(2);