diff --git a/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java b/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java index 8f6400766..92f6e008e 100644 --- a/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java @@ -12,6 +12,7 @@ import com.gmail.nossr50.datatypes.database.DatabaseType; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.runnables.database.DatabaseConversionTask; +import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.util.player.UserManager; public class ConvertDatabaseCommand implements CommandExecutor { @@ -61,7 +62,7 @@ public class ConvertDatabaseCommand implements CommandExecutor { mcMMO.getDatabaseManager().saveUser(profile); } - UserManager.track(player); + new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading } new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p); diff --git a/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index f93846518..298bc3465 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -9,6 +9,7 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.runnables.database.FormulaConversionTask; +import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.util.player.UserManager; public class ConvertExperienceCommand implements CommandExecutor { @@ -37,7 +38,7 @@ public class ConvertExperienceCommand implements CommandExecutor { new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1); for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { - UserManager.track(player); + new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading } return true; diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 5ca626b02..b0845e2f9 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -38,6 +38,7 @@ import com.gmail.nossr50.runnables.UpdaterResultAsyncTask; import com.gmail.nossr50.runnables.backups.CleanBackupsTask; import com.gmail.nossr50.runnables.database.UserPurgeTask; import com.gmail.nossr50.runnables.party.PartyAutoKickTask; +import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.runnables.player.PowerLevelUpdatingTask; import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.skills.alchemy.Alchemy; @@ -167,8 +168,7 @@ public class mcMMO extends JavaPlugin { holidayManager = new HolidayManager(); for (Player player : getServer().getOnlinePlayers()) { - UserManager.track(player); // In case of reload add all users back into UserManager - ScoreboardManager.setupPlayer(player); + new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading } debug("Version " + getDescription().getVersion() + " is enabled!"); diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index 474231f9b..6a21339cc 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; +import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.util.player.UserManager; public final class Misc { @@ -112,7 +113,7 @@ public final class Misc { if (player != null) { UserManager.remove(player); - UserManager.track(player); + new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading } }