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

@ -90,6 +90,7 @@ public class vMinecraftListener extends PluginListener {
public void onLogin(Player player){
vMinecraftUsers.addUser(player);
}
public boolean onIgnite(Block block, Player player) {
if(vMinecraftSettings.stopFire){
if (vMinecraftSettings.fireNoSpread.contains(block)){

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();