From db3afc71f8b5b2f210d7c17a77f45d326c412e0b Mon Sep 17 00:00:00 2001 From: fillefilip8 Date: Sat, 5 Mar 2016 17:00:07 +0100 Subject: [PATCH] Changed JavaDoc and added a another method to just get the UUID of all ported players. --- src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java | 9 +++++++++ src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java index e8ed8ad37..aa6ed428c 100644 --- a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java +++ b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java @@ -127,6 +127,15 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { return Collections.unmodifiableList(nonPortedPlayers); } + @Override + public List getPortedPlayersList() { + List players = new ArrayList(); + for(UUID uuid : portedPlayers.keySet()){ + players.add(uuid); + } + return Collections.unmodifiableList(players); + } + public void setDebug(boolean value) { this.debug = value; } diff --git a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java b/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java index aaba886e9..3e5270766 100644 --- a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java +++ b/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java @@ -38,13 +38,22 @@ public interface ViaVersionAPI { /** * Returns all ported players. (1.9 players) + * Warning: This returns a unmodifiable map. * @return Map of all ported players. */ Map getPortedPlayers(); /** * Returns all non ported players. (1.8 players) + * Warning: This returns a unmodifiable list. * @return List of all non ported players. */ List getNonPortedPlayers(); + + /** + * Returns all ported players. (1.9 players) + * Warning: This returns a unmodifiable list. + * @return List of all ported players. + */ + List getPortedPlayersList(); }