From e5a97641b3df84320103c524ba42fea333a19ca7 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 1 Dec 2010 13:15:37 -0800 Subject: [PATCH] some more tweaking done --- vMinecraftUsers.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vMinecraftUsers.java b/vMinecraftUsers.java index e4c69026c..cf2682bfe 100644 --- a/vMinecraftUsers.java +++ b/vMinecraftUsers.java @@ -2,6 +2,7 @@ import java.io.*; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; + public class vMinecraftUsers { private static volatile vMinecraftUsers instance; protected static final Logger log = Logger.getLogger("Minecraft"); @@ -41,11 +42,13 @@ public class vMinecraftUsers { public static void addUser(Player player){ FileWriter writer = null; String location = "vminecraftusers.txt"; + BufferedWriter bw = new BufferedWriter(new FileWriter(location, true)); try { - writer = new FileWriter(location); - writer.append(player.getName()+"::::"); - } catch (Exception e) { - log.log(Level.SEVERE, "Exception while trying to add user with writer to " + location, e); + bw.append(player.getName()+"::::\r\n"); + bw.newLine(); + bw.close(); + } catch (IOException e) { + log.log(Level.SEVERE, "Exception while trying to add user with BufferedWriter to " + location, e); } finally { try { if (writer != null) { @@ -63,4 +66,7 @@ public class vMinecraftUsers { } return instance; } + public static void getRow(){ + + } }