Changed Fight Scoreboard to SWScoreboard #194
@ -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);
|
||||
Lixfel
hat
Listener sollen im Ordner Listener sein, in diesem Fall solltest du wsl. einfach im ConnectionListener im JonListener einen Aufruf hierher machen. Listener sollen im Ordner Listener sein, in diesem Fall solltest du wsl. einfach im ConnectionListener im JonListener einen Aufruf hierher machen.
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Fände es besser, direkt titel und scores zu speichern (siehe unten)