Update SQL Queries + SQL DB Schema

This commit is contained in:
nossr50
2020-08-20 21:24:48 -07:00
parent 642a351bb5
commit 17137f3a08
8 changed files with 437 additions and 217 deletions

View File

@@ -52,12 +52,18 @@ public class ConvertDatabaseCommand implements CommandExecutor {
mcMMO.getUserManager().saveAllSync();
mcMMO.getUserManager().clearAll();
if(oldDatabase == null) {
sender.sendMessage("Could not load the other database, failed to convert users.");
return true;
}
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
PlayerProfile profile = oldDatabase.loadPlayerProfile(player.getUniqueId());
if (profile.isLoaded()) {
mcMMO.getDatabaseManager().saveUser(profile);
}
if(profile == null)
continue;
mcMMO.getUserManager().saveUserImmediately(profile.getPersistentPlayerData(), true);
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}