added tps
Dieser Commit ist enthalten in:
Ursprung
3fdb9072f8
Commit
fc14d83754
@ -31,19 +31,29 @@ public class CommandInfo implements CommandExecutor {
|
||||
}
|
||||
sender.sendMessage(membermessage.toString());
|
||||
|
||||
StringBuilder tpsmessage = new StringBuilder().append(BauSystem.PREFIX).append("TPS:§e");
|
||||
for(float tps : getTps()){
|
||||
tpsmessage.append(tps);
|
||||
}
|
||||
sender.sendMessage(tpsmessage.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
public static float[] getTps() {
|
||||
double[] tps;
|
||||
switch(Core.getVersion()){
|
||||
|
||||
switch (Core.getVersion()) {
|
||||
case 15:
|
||||
tps = CommandInfo_15.getTps();
|
||||
break;
|
||||
default:
|
||||
tps = CommandInfo_12.getTps();
|
||||
}
|
||||
StringBuilder tpsmessage = new StringBuilder().append(BauSystem.PREFIX).append("TPS:§e");
|
||||
for(double t : tps){
|
||||
tpsmessage.append(String.format(" %.1f", t));
|
||||
|
||||
float[] roundedTps = new float[3];
|
||||
for(int i = 0; i < tps.length; i++) {
|
||||
roundedTps[i] = Float.parseFloat(String.format("%.1f", tps[0]));
|
||||
}
|
||||
sender.sendMessage(tpsmessage.toString());
|
||||
return false;
|
||||
return roundedTps;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package de.steamwar.bausystem.world;
|
||||
|
||||
import de.steamwar.bausystem.commands.CommandFreeze;
|
||||
import de.steamwar.bausystem.commands.CommandInfo;
|
||||
import de.steamwar.bausystem.commands.CommandTNT;
|
||||
import de.steamwar.scoreboard.SWScoreboard;
|
||||
import de.steamwar.scoreboard.ScoreboardCallback;
|
||||
@ -28,6 +29,8 @@ public class BauScoreboard implements Listener {
|
||||
data.put("§2 ", 3);
|
||||
data.put("§eTNT§8: " + (!CommandTNT.getInstance().isOn() ? "§aan" : "§caus"), 2);
|
||||
data.put("§eFreeze§8: " + (!CommandFreeze.getInstance().isOn() ? "§aan" : "§caus"), 1);
|
||||
data.put("§3 ", 2);
|
||||
data.put("§eTPS§8: " + CommandInfo.getTps()[0], 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren