mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Forgot to change getParties
This commit is contained in:
		@@ -4,6 +4,7 @@ import java.util.List;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.gmail.nossr50.party.Party;
 | 
				
			||||||
import com.gmail.nossr50.party.PartyManager;
 | 
					import com.gmail.nossr50.party.PartyManager;
 | 
				
			||||||
import com.gmail.nossr50.util.Users;
 | 
					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>
 | 
					     * </br>
 | 
				
			||||||
     * This function is designed for API usage.
 | 
					     * This function is designed for API usage.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @return the list of parties.
 | 
					     * @return the list of parties.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static List<String> getParties() {
 | 
					    public static List<Party> getParties() {
 | 
				
			||||||
        return PartyManager.getInstance().getParties();
 | 
					        return PartyManager.getInstance().getParties();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,6 @@
 | 
				
			|||||||
package com.gmail.nossr50.party;
 | 
					package com.gmail.nossr50.party;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.BufferedReader;
 | 
					 | 
				
			||||||
import java.io.File;
 | 
					import java.io.File;
 | 
				
			||||||
import java.io.FileReader;
 | 
					 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.List;
 | 
					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.
 | 
					     * @return the list of parties.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public List<String> getParties() {
 | 
					    public List<Party> 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());
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return parties;
 | 
					        return parties;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user