SteamWar/FightSystem
Archiviert
13
1

Fixing Scoreboard

Dieser Commit ist enthalten in:
Chaoscaot 2020-11-16 21:31:03 +01:00
Ursprung 57d5d0fadc
Commit 7dbd3ab5cb

Datei anzeigen

@ -24,7 +24,6 @@ import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.record.RecordSystem;
import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.winconditions.*;
import de.steamwar.scoreboard.SWScoreboard;
@ -47,6 +46,7 @@ public class FightScoreboard implements Listener {
private static ScoreBoardObjective objective;
public static void init(){
Bukkit.getPluginManager().registerEvents(new FightScoreboard(), FightSystem.getPlugin());
Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), FightScoreboard::nextIndexDisplay, 0, 200);
}
@ -88,12 +88,12 @@ public class FightScoreboard implements Listener {
if (Config.Timeout || Config.Points || Config.HeartRatioTimeout) {
int fightTime = FightSystem.getFightTime();
if (fightTime >= 60)
objective.addScore("§7Zeit: §a" + fightTime / 60 + "m " + fightTime % 60 + "s", 3);
objective.addScore("§7Zeit: §a" + fightTime / 60 + "m " + fightTime % 60 + "s", 4);
else
objective.addScore("§7Zeit: §a" + fightTime + "s", 3);
objective.addScore("§7Zeit: §a" + fightTime + "s", 4);
}
setScore("§7TPS: §e" + TPSWatcher.getTPS(), 3);
objective.addScore("§7TPS: §e" + TPSWatcher.getTPS(), 3);
if(fullScoreboard.contains(FightSystem.getFightState())){
if (Config.PercentSystem){
@ -116,12 +116,6 @@ public class FightScoreboard implements Listener {
return objective;
}
private static void setScore(String key, int value){
objective.getScore(key).setScore(value);
if(Config.recording())
RecordSystem.scoreboardData(key, value);
}
private static FightTeam getIndexDisplay() {
if(index == 1)
return Fight.redTeam;