From 200ac53078d0951ab5f85ad7bf5d18262dbe2ad1 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 12 Feb 2013 09:22:36 -0500 Subject: [PATCH] Add function to get a list of all players in a party to the API. --- src/main/java/com/gmail/nossr50/api/PartyAPI.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/api/PartyAPI.java b/src/main/java/com/gmail/nossr50/api/PartyAPI.java index 9fe7af7f2..b8c540e14 100644 --- a/src/main/java/com/gmail/nossr50/api/PartyAPI.java +++ b/src/main/java/com/gmail/nossr50/api/PartyAPI.java @@ -125,8 +125,7 @@ public final class PartyAPI { * @return all the players in the player's party * @deprecated */ - // TODO: I naively tried to add another getAllMembers that returns a List, but that wasn't possible - // since the return type isn't part of the the method's signature. If anybody has an idea... + @Deprecated public static List getAllMembers(Player player) { List memberNames = new ArrayList(); @@ -137,6 +136,18 @@ public final class PartyAPI { return memberNames; } + /** + * Get a list of all players in this player's party. + *
+ * This function is designed for API usage. + * + * @param player The player to check + * @return all the players in the player's party + */ + public static List getOnlineAndOfflineMembers(Player player) { + return PartyManager.getAllMembers(player); + } + /** * Get a list of all online players in this party. *