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 JSONConfig config;
|
||||||
private final Scoreboard scoreboard;
|
private final Scoreboard scoreboard;
|
||||||
private final ArrayList<Team> teams;
|
private final ArrayList<Team> teams;
|
||||||
|
private static final String TEAM_PREFIX = "~";
|
||||||
|
|
||||||
public TeamManager(final Varo plugin) {
|
public TeamManager(final Varo plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
@ -42,17 +43,18 @@ public class TeamManager {
|
||||||
for (final Object jsonRawTeam : jsonTeams) {
|
for (final Object jsonRawTeam : jsonTeams) {
|
||||||
final JSONObject jsonTeam = (JSONObject) jsonRawTeam;
|
final JSONObject jsonTeam = (JSONObject) jsonRawTeam;
|
||||||
final Team team, afkTeam;
|
final Team team, afkTeam;
|
||||||
if (jsonTeam.get("Name") == null)
|
if (jsonTeam.get("Name") == null) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (this.scoreboard.getTeam((String) jsonTeam.get("Name")) == null) {
|
if (this.scoreboard.getTeam((String) jsonTeam.get("Name")) == null) {
|
||||||
team = this.scoreboard.registerNewTeam((String) jsonTeam.get("Name"));
|
team = this.scoreboard.registerNewTeam((String) jsonTeam.get("Name"));
|
||||||
} else {
|
} else {
|
||||||
team = this.scoreboard.getTeam((String) jsonTeam.get("Name"));
|
team = this.scoreboard.getTeam((String) jsonTeam.get("Name"));
|
||||||
}
|
}
|
||||||
if (this.scoreboard.getTeam("afk" + jsonTeam.get("Name")) == null) {
|
if (this.scoreboard.getTeam(TEAM_PREFIX + jsonTeam.get("Name")) == null) {
|
||||||
afkTeam = this.scoreboard.registerNewTeam("afk" + jsonTeam.get("Name"));
|
afkTeam = this.scoreboard.registerNewTeam(TEAM_PREFIX + jsonTeam.get("Name"));
|
||||||
} else {
|
} 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(team);
|
||||||
this.teams.add(afkTeam);
|
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.");
|
"§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) {
|
public void setAFK(final String player) {
|
||||||
final Team oldTeam = getTeamByPlayer(player);
|
final Team oldTeam = getTeamByPlayer(player);
|
||||||
for (final Team team : this.teams) {
|
for (final Team team : this.teams) {
|
||||||
if (team.getName().equals("afk" + oldTeam.getName())) {
|
if (team.getName().equals(TEAM_PREFIX + oldTeam.getName())) {
|
||||||
team.addEntry(player);
|
team.addEntry(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue