TokenViewer doesn't crash now.. Just need it to display

This commit is contained in:
Chris H
2019-03-31 22:48:57 -04:00
parent a050f7c26c
commit f5a4360339
32 changed files with 160 additions and 52 deletions

View File

@@ -39,6 +39,18 @@ public class TokenDb implements ITokenDatabase {
return getToken(tokenName, CardEdition.UNKNOWN.getName());
}
public void preloadTokens() {
for(CardEdition edition : this.editions) {
for (String name : edition.getTokens().keySet()) {
try {
getToken(name, edition.getCode());
} catch(Exception e) {
System.out.println(name + "_" + edition.getCode() + " defined in Edition file, but not defined as a token script.");
}
}
}
}
@Override
public PaperToken getToken(String tokenName, String edition) {
String fullName = String.format("%s_%s", tokenName, edition.toLowerCase());