mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Adding players to the PlayerList should work now.
This commit is contained in:
parent
d65252d289
commit
0233605785
@ -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)){
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user