Bläddra i källkod

We already have a task for Profile saving

bm01 12 år sedan
förälder
incheckning
09373c45f3
1 ändrade filer med 3 tillägg och 12 borttagningar
  1. 3 12
      src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java

+ 3 - 12
src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java

@@ -307,13 +307,11 @@ public class PlayerProfile {
     }
 
     public void save() {
-        save(true);
-    }
-
-    public void save(boolean override) {
         Long timestamp = System.currentTimeMillis();
-        if (timestamp < (lastSave + ((long) Config.getInstance().getSaveInterval() * 60000)) && !override)
+
+        if (timestamp < (lastSave + ((long) Config.getInstance().getSaveInterval() * 60000))) {
             return;
+        }
 
         // If we are using mysql save to database
         if (Config.getInstance().getUseMySQL()) {
@@ -944,12 +942,10 @@ public class PlayerProfile {
 
     public void setSkillXpLevel(SkillType skillType, int newValue) {
         skillsXp.put(skillType, newValue);
-        save(false);
     }
 
     public void skillUp(SkillType skillType, int newValue) {
         skills.put(skillType, skills.get(skillType) + newValue);
-        save(false);
     }
 
     //    /**
@@ -1069,7 +1065,6 @@ public class PlayerProfile {
         else {
             skillsXp.put(skillType, skillsXp.get(skillType) - xp);
         }
-        save(false);
     }
 
     /**
@@ -1097,7 +1092,6 @@ public class PlayerProfile {
             skills.put(skillType, newValue);
             skillsXp.put(skillType, 0);
         }
-        save(false);
     }
 
     /**
@@ -1125,7 +1119,6 @@ public class PlayerProfile {
             skills.put(skillType, skills.get(skillType) + levels);
             skillsXp.put(skillType, 0);
         }
-        save(false);
     }
 
     /**
@@ -1204,7 +1197,6 @@ public class PlayerProfile {
 
     public void setParty(Party party) {
         this.party = party;
-        save(false);
     }
 
     public Party getParty() {
@@ -1221,7 +1213,6 @@ public class PlayerProfile {
 
     public void removeParty() {
         party = null;
-        save(false);
     }
 
     public void removeInvite() {