Browse Source

A few changes :3

nossr50 14 years ago
parent
commit
8b981cde75

+ 2 - 1
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 {

+ 8 - 2
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<PlayerProfile> players;
     public static HashMap<Player, PlayerProfile> players = new HashMap<Player, PlayerProfile>();
@@ -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 {

+ 1 - 1
mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java

@@ -50,7 +50,7 @@ public class PlayerProfile
 	
 	//Time to HashMap this shiz
 	HashMap<String, Integer> stats = new HashMap<String, Integer>(); //Skills and XP
-    String location = "plugins/mcMMO/mcmmo.users";
+    String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
         
 	public PlayerProfile(Player player)
 	{

+ 0 - 2
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){