diff --git a/varo/src/main/java/de/cliffbreak/varo/managers/TeamManager.java b/varo/src/main/java/de/cliffbreak/varo/managers/TeamManager.java index a644600..3aa4b4b 100644 --- a/varo/src/main/java/de/cliffbreak/varo/managers/TeamManager.java +++ b/varo/src/main/java/de/cliffbreak/varo/managers/TeamManager.java @@ -25,6 +25,7 @@ public class TeamManager { private final JSONConfig config; private final Scoreboard scoreboard; private final ArrayList teams; + private static final String TEAM_PREFIX = "~"; public TeamManager(final Varo plugin) { this.plugin = plugin; @@ -42,17 +43,18 @@ public class TeamManager { for (final Object jsonRawTeam : jsonTeams) { final JSONObject jsonTeam = (JSONObject) jsonRawTeam; final Team team, afkTeam; - if (jsonTeam.get("Name") == null) + if (jsonTeam.get("Name") == null) { continue; + } if (this.scoreboard.getTeam((String) jsonTeam.get("Name")) == null) { team = this.scoreboard.registerNewTeam((String) jsonTeam.get("Name")); } else { team = this.scoreboard.getTeam((String) jsonTeam.get("Name")); } - if (this.scoreboard.getTeam("afk" + jsonTeam.get("Name")) == null) { - afkTeam = this.scoreboard.registerNewTeam("afk" + jsonTeam.get("Name")); + if (this.scoreboard.getTeam(TEAM_PREFIX + jsonTeam.get("Name")) == null) { + afkTeam = this.scoreboard.registerNewTeam(TEAM_PREFIX + jsonTeam.get("Name")); } else { - afkTeam = this.scoreboard.getTeam("afk" + jsonTeam.get("Name")); + afkTeam = this.scoreboard.getTeam(TEAM_PREFIX + jsonTeam.get("Name")); } this.teams.add(team); this.teams.add(afkTeam); @@ -81,7 +83,6 @@ public class TeamManager { "§c§lFehler:§r§c beim Verbinden mit der Mojang-API ist ein Fehler aufgetreten. Eventuell sind die Mojang Server down."); } } - } } @@ -97,7 +98,7 @@ public class TeamManager { public void setAFK(final String player) { final Team oldTeam = getTeamByPlayer(player); for (final Team team : this.teams) { - if (team.getName().equals("afk" + oldTeam.getName())) { + if (team.getName().equals(TEAM_PREFIX + oldTeam.getName())) { team.addEntry(player); } }