SteamWar/MissileWars
Archiviert
13
0
Dieser Commit ist enthalten in:
Lixfel 2021-01-30 14:59:49 +01:00
Ursprung 6dd085c425
Commit e770551a91

Datei anzeigen

@ -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);