Bläddra i källkod

Forgot to change getParties

bm01 13 år sedan
förälder
incheckning
5fe227b874

+ 3 - 2
src/main/java/com/gmail/nossr50/api/PartyAPI.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.bukkit.entity.Player;
 
+import com.gmail.nossr50.party.Party;
 import com.gmail.nossr50.party.PartyManager;
 import com.gmail.nossr50.util.Users;
 
@@ -49,13 +50,13 @@ public final class PartyAPI {
     }
 
     /**
-     * Get a list of all current party names.
+     * Get a list of all current parties.
      * </br>
      * This function is designed for API usage.
      *
      * @return the list of parties.
      */
-    public static List<String> getParties() {
+    public static List<Party> getParties() {
         return PartyManager.getInstance().getParties();
     }
 

+ 2 - 31
src/main/java/com/gmail/nossr50/party/PartyManager.java

@@ -1,8 +1,6 @@
 package com.gmail.nossr50.party;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -156,38 +154,11 @@ public class PartyManager {
     }
 
     /**
-     * Get a list of all current party names.
+     * Get a list of all current parties.
      *
      * @return the list of parties.
      */
-    public List<String> getParties() {
-        String location = mcMMO.usersFile;
-        ArrayList<String> parties = new ArrayList<String>();
-
-        try {
-            FileReader file = new FileReader(location);
-            BufferedReader in = new BufferedReader(file);
-            String line = "";
-
-            while ((line = in.readLine()) != null) {
-                String[] character = line.split(":");
-                String theparty = null;
-
-                //Party
-                if (character.length > 3) {
-                    theparty = character[3];
-                }
-
-                if (!parties.contains(theparty)) {
-                    parties.add(theparty);
-                }
-            }
-            in.close();
-        }
-        catch (Exception e) {
-            plugin.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString());
-        }
-
+    public List<Party> getParties() {
         return parties;
     }