SteamWar/BauSystem
Archiviert
13
0

Fix BauScoreboard

Dieser Commit ist enthalten in:
jojo 2020-11-15 13:54:00 +01:00
Ursprung 50c18084b4
Commit 179632cd21

Datei anzeigen

@ -73,11 +73,7 @@ public class BauScoreboard implements Listener {
} }
strings.add("§4"); strings.add("§4");
if (CommandTPSLimiter.getCurrentTPSLimit() == 20) { strings.add("§eTPS§8: " + tpsColor() + TPSWatcher.getTPS() + tpsLimit());
strings.add("§eTPS§8: §7" + TPSWatcher.getTPS());
} else {
strings.add("§eTPS§8: §7" + TPSWatcher.getTPS() + "§8/§7" + CommandTPSLimiter.getCurrentTPSLimit());
}
int i = strings.size(); int i = strings.size();
HashMap<String, Integer> result = new HashMap<>(); HashMap<String, Integer> result = new HashMap<>();
@ -89,4 +85,22 @@ public class BauScoreboard implements Listener {
private long traceTicks() { private long traceTicks() {
return (System.currentTimeMillis() - TNTRecorder.recordStart) / 50; return (System.currentTimeMillis() - TNTRecorder.recordStart) / 50;
} }
private String tpsColor() {
double tps = TPSWatcher.getTPS();
if (tps > CommandTPSLimiter.getCurrentTPSLimit() * 0.9) {
return "§a";
}
if (tps > CommandTPSLimiter.getCurrentTPSLimit() * 0.5) {
return "§e";
}
return "§c";
}
private String tpsLimit() {
if (CommandTPSLimiter.getCurrentTPSLimit() == 20) {
return "";
}
return "§8/§7" + CommandTPSLimiter.getCurrentTPSLimit();
}
} }