Add /tpslimit Command #113
@ -73,11 +73,7 @@ public class BauScoreboard implements Listener {
|
||||
}
|
||||
|
||||
strings.add("§4");
|
||||
if (CommandTPSLimiter.getCurrentTPSLimit() == 20) {
|
||||
strings.add("§eTPS§8: §7" + TPSWatcher.getTPS());
|
||||
} else {
|
||||
strings.add("§eTPS§8: §7" + TPSWatcher.getTPS() + "§8/§7" + CommandTPSLimiter.getCurrentTPSLimit());
|
||||
}
|
||||
strings.add("§eTPS§8: " + tpsColor() + TPSWatcher.getTPS() + tpsLimit());
|
||||
|
||||
int i = strings.size();
|
||||
HashMap<String, Integer> result = new HashMap<>();
|
||||
@ -89,4 +85,22 @@ public class BauScoreboard implements Listener {
|
||||
private long traceTicks() {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren