From 7dbd3ab5cbf80bcf09537464872a51efb589cb50 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 16 Nov 2020 21:31:03 +0100 Subject: [PATCH] Fixing Scoreboard --- .../fightsystem/utils/FightScoreboard.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java index 7f628ae..c99de72 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java @@ -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;