Skip to content

Commit

Permalink
Support NPC names in list.formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 26, 2013
1 parent f441d19 commit 65f0aef
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dList.java
Expand Up @@ -270,7 +270,18 @@ public String getAttribute(Attribute attribute) {

for (int n = 0; n < this.size(); n++) {

dScriptArg.append(this.get(n).replaceAll("\\w\\w?@", ""));
if (dNPC.matches(get(n))) {
dNPC gotten = dNPC.valueOf(get(n));
if (gotten != null) {
dScriptArg.append(gotten.getName());
}
else {
dScriptArg.append(get(n).replaceAll("\\w\\w?@", ""));
}
}
else {
dScriptArg.append(get(n).replaceAll("\\w\\w?@", ""));
}

if (n == this.size() - 2) dScriptArg.append(" and ");
else dScriptArg.append(", ");
Expand Down

0 comments on commit 65f0aef

Please sign in to comment.