This commit is contained in:
nossr50 2019-06-05 23:50:39 -07:00
parent 426b2d27e7
commit 0638f4c437
5 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.69-SNAPSHOT</version>
<version>2.1.69</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -144,9 +144,9 @@ public class PlayerProfile {
" Check your console for errors and inspect your DB for issues.");
}
} else {
saveAttempts = 0;
}
saveAttempts = 0;
}
public String getPlayerName() {

View File

@ -502,7 +502,9 @@ public class PlayerListener implements Listener {
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
mcMMOPlayer.logout(false);
//There's an issue with using Async saves on player quit
//Basically there are conditions in which an async task does not execute fast enough to save the data if the server shutdown shortly after this task was scheduled
mcMMOPlayer.logout(true);
}
/**

View File

@ -332,7 +332,7 @@ public class mcMMO extends JavaPlugin {
placeStore.saveAll(); // Save our metadata
placeStore.cleanUp(); // Cleanup empty metadata stores
}
catch (NullPointerException e) { e.printStackTrace(); }
catch (Exception e) { e.printStackTrace(); }
debug("Canceling all tasks...");
getServer().getScheduler().cancelTasks(this); // This removes our tasks

View File

@ -33,7 +33,8 @@ public final class UserManager {
}
public static void cleanupPlayer(McMMOPlayer mcMMOPlayer) {
playerDataSet.remove(mcMMOPlayer);
if(playerDataSet != null && playerDataSet.contains(mcMMOPlayer))
playerDataSet.remove(mcMMOPlayer);
}
/**