Permalink
Browse files

Return associative array of teams for scoreboards

  • Loading branch information...
PseudoKnight committed Aug 26, 2018
1 parent 3794a57 commit aa81d3a350c2074654fa4d49f8270db92b5f2a30
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/main/java/com/laytonsmith/core/functions/Scoreboards.java
@@ -433,9 +433,9 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
} else {
s = getBoard(args[0].val(), t);
}
CArray ret = new CArray(t);
CArray ret = CArray.GetAssociativeArray(t);
for(MCTeam team : s.getTeams()) {
ret.push(getTeam(team, t), t);
ret.set(team.getName(), getTeam(team, t), t);
}
return ret;
}
@@ -453,8 +453,9 @@ public String getName() {
@Override
public String docs() {
return "array {[scoreboard]} Returns an array of arrays about the teams on the given scoreboard,"
+ " which defaults to '" + MAIN + "' if not given. The arrays contain the keys name,"
+ " displayname, prefix, suffix, size, options, and players.";
+ " which defaults to '" + MAIN + "' if not given. The array keys are the team names,"
+ " and each value is a team array containing the keys: name, displayname, prefix, suffix, size,"
+ " options, and players.";
}
@Override

0 comments on commit aa81d3a

Please sign in to comment.