1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-19 18:33:00 +01:00

Adding players to the PlayerList should work now.

This commit is contained in:
cerevisiae
2010-12-07 22:53:51 -06:00
parent d65252d289
commit 0233605785
2 changed files with 4 additions and 21 deletions

View File

@@ -64,29 +64,11 @@ public class vMinecraftUsers {
}
return false;
}
public static void addUser(Player player){
FileWriter writer = null;
String location = "vminecraftusers.txt";
String playerName = player.getName();
if (!vMinecraftUsers.getInstance().doesPlayerExist(playerName)){ //Check to see if the player exists before writing
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(location, true));
bw.append(player.getName()+":::::\r");
bw.newLine();
bw.close();
} catch (Exception e) {
log.log(Level.SEVERE, "Exception while trying to add user with BufferedWriter to " + location, e);
} finally {
try {
if (writer != null) {
writer.close();
}
} catch (IOException e) {
log.log(Level.SEVERE, "Exception while closing BufferedWriter to " + location, e);
}
}
}
players.addPlayer(player);
}
public static vMinecraftUsers getInstance() {
if (instance == null) {
instance = new vMinecraftUsers();