mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-02-20 16:49:36 +01:00
Forgot to change getParties
This commit is contained in:
parent
cbaf2f8370
commit
5fe227b874
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user