From 8b981cde7530039ed38bb7e7b21e320cdec67c96 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 16 Jul 2011 00:52:15 -0700 Subject: [PATCH] A few changes :3 --- mcMMO/com/gmail/nossr50/Leaderboard.java | 3 ++- mcMMO/com/gmail/nossr50/Users.java | 10 ++++++++-- mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java | 2 +- mcMMO/com/gmail/nossr50/skills/Skills.java | 2 -- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mcMMO/com/gmail/nossr50/Leaderboard.java b/mcMMO/com/gmail/nossr50/Leaderboard.java index 136d97bd3..ba6a203c8 100644 --- a/mcMMO/com/gmail/nossr50/Leaderboard.java +++ b/mcMMO/com/gmail/nossr50/Leaderboard.java @@ -121,7 +121,8 @@ public class Leaderboard { String theLocation = "plugins/mcMMO/FlatFileStuff/Leaderboards/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$ //CHECK IF THE FILE EXISTS File theDir = new File(theLocation); - if(!theDir.exists()){ + if(!theDir.exists()) + { //properties = new PropertiesFile(location); FileWriter writer = null; try { diff --git a/mcMMO/com/gmail/nossr50/Users.java b/mcMMO/com/gmail/nossr50/Users.java index d9a9e89ca..11218571e 100644 --- a/mcMMO/com/gmail/nossr50/Users.java +++ b/mcMMO/com/gmail/nossr50/Users.java @@ -14,6 +14,8 @@ public class Users { private static volatile Users instance; protected static final Logger log = Logger.getLogger("Minecraft"); String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users"; + String directory = "plugins/mcMMO/FlatFileStuff/"; + String directoryb = "plugins/mcMMO/FlatFileStuff/Leaderboards/"; //public static ArrayList players; public static HashMap players = new HashMap(); @@ -36,14 +38,18 @@ public class Users { public void loadUsers() { + new File(directory).mkdir(); + new File(directoryb).mkdir(); File theDir = new File(location); - if(!theDir.exists()){ + if(!theDir.exists()) + { //properties = new PropertiesFile(location); FileWriter writer = null; try { writer = new FileWriter(location); //writer.write("#Storage place for user information\r\n"); - } catch (Exception e) { + } catch (Exception e) + { log.log(Level.SEVERE, "Exception while creating " + location, e); } finally { try { diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java index 76a82b729..e08d468d9 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -50,7 +50,7 @@ public class PlayerProfile //Time to HashMap this shiz HashMap stats = new HashMap(); //Skills and XP - String location = "plugins/mcMMO/mcmmo.users"; + String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users"; public PlayerProfile(Player player) { diff --git a/mcMMO/com/gmail/nossr50/skills/Skills.java b/mcMMO/com/gmail/nossr50/skills/Skills.java index c1226b856..f2ce8797e 100644 --- a/mcMMO/com/gmail/nossr50/skills/Skills.java +++ b/mcMMO/com/gmail/nossr50/skills/Skills.java @@ -116,8 +116,6 @@ public class Skills { } public static void monitorSkills(Player player){ PlayerProfile PP = Users.getProfile(player); - if(PP == null) - Users.addUser(player); if(PP != null) { if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){