diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java index d7e582a..3cf6766 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightScoreboard.java @@ -45,7 +45,7 @@ public class FightScoreboard implements Listener { private static ScoreBoardObjective objective; public static void init(){ - Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), () -> nextIndexDisplay(), 0, 200); + Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), FightScoreboard::nextIndexDisplay, 0, 200); } public static Scoreboard getScoreboard() { @@ -54,7 +54,7 @@ public class FightScoreboard implements Listener { @EventHandler() public void onPlayerJoin(PlayerJoinEvent event) { - SWScoreboard.createScoreboard(event.getPlayer(), new ScoreboardCallback() { + SWScoreboard.createScoreboard(event.getPlayer(), new ScoreboardCallback() { @Override public HashMap getData() { return objective.getScores(); @@ -73,7 +73,7 @@ public class FightScoreboard implements Listener { } private static ScoreBoardObjective teamScoreboard(FightTeam fightTeam){ - ScoreBoardObjective objective = new ScoreBoardObjective(fightTeam.getColoredName()); + final ScoreBoardObjective objective = new ScoreBoardObjective(fightTeam.getColoredName()); fightTeam.getPlayers().forEach(fp -> { if(fp.isLiving()) objective.addScore(fightTeam.getPrefix() + fp.getPlayer().getName(), (int) Math.ceil(fp.getPlayer().getHealth())); @@ -82,7 +82,7 @@ public class FightScoreboard implements Listener { } private static ScoreBoardObjective generalScoreboard(){ - ScoreBoardObjective objective = new ScoreBoardObjective("§6Kampf"); + final ScoreBoardObjective objective = new ScoreBoardObjective("§6Kampf"); if (Config.Timeout || Config.Points || Config.HeartRatioTimeout) { int fightTime = FightSystem.getFightTime(); if (fightTime >= 60) @@ -123,9 +123,8 @@ public class FightScoreboard implements Listener { private static void nextIndexDisplay() { index++; if(index > 2) - return; - index = 0; - FightTeam team = getIndexDisplay(); + index = 0; + final FightTeam team = getIndexDisplay(); if(team != null) objective = teamScoreboard(team); else @@ -135,7 +134,7 @@ public class FightScoreboard implements Listener { private static class ScoreBoardObjective { private final String title; - private HashMap scores = new HashMap<>(); + private final HashMap scores = new HashMap<>(); public ScoreBoardObjective(String title) { this.title = title;