diff --git a/src/main/java/cactusServer/entities/Instance.java b/src/main/java/cactusServer/entities/Instance.java index 3c8a079..7e6ea0e 100644 --- a/src/main/java/cactusServer/entities/Instance.java +++ b/src/main/java/cactusServer/entities/Instance.java @@ -97,6 +97,21 @@ public HashMap getCharacters() { return characterMap; } + + @JSONHint(ignore = true) + public HashMap getCharacters(String accountURI) { + if (accountURI == null || accountURI.isEmpty()) { + return getCharacters(); + } + HashMap returnedMap = new HashMap<>(); + for (String id : characterMap.keySet()) { + Character character = characterMap.get(id); + if (character.getAccountURI().equals(accountURI)) { + returnedMap.put(id, character); + } + } + return returnedMap; + } public Character getCharacter(String characterId) { return characterMap.get(characterId);