fix: TeamManager Char Limit
This commit is contained in:
parent
fe09426f69
commit
4def45e8cf
1 changed files with 7 additions and 6 deletions
|
@ -25,6 +25,7 @@ public class TeamManager {
|
|||
private final JSONConfig config;
|
||||
private final Scoreboard scoreboard;
|
||||
private final ArrayList<Team> 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue