mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Fix another bug where usernames can be saved as null for FlatFileDB
This commit is contained in:
@ -58,7 +58,7 @@ public class ConvertDatabaseCommand implements CommandExecutor {
|
||||
UserManager.clearAll();
|
||||
|
||||
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
PlayerProfile profile = oldDatabase.loadPlayerProfile(player.getUniqueId(), null);
|
||||
PlayerProfile profile = oldDatabase.loadPlayerProfile(player);
|
||||
|
||||
if (profile.isLoaded()) {
|
||||
mcMMO.getDatabaseManager().saveUser(profile);
|
||||
|
@ -97,12 +97,9 @@ public abstract class ExperienceCommand implements TabExecutor {
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
UUID uuid = null;
|
||||
OfflinePlayer offlinePlayer = mcMMO.p.getServer().getOfflinePlayer(playerName);
|
||||
PlayerProfile profile;
|
||||
|
||||
uuid = offlinePlayer.getUniqueId();
|
||||
profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid, null);
|
||||
profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName);
|
||||
|
||||
//Check loading by UUID
|
||||
if (CommandUtils.unloadedProfile(sender, profile)) {
|
||||
|
@ -79,11 +79,8 @@ public class SkillresetCommand implements TabExecutor {
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
UUID uuid = null;
|
||||
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(playerName);
|
||||
uuid = player.getUniqueId();
|
||||
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid, playerName);
|
||||
OfflinePlayer offlinePlayer = mcMMO.p.getServer().getOfflinePlayer(playerName);
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(offlinePlayer);
|
||||
|
||||
//Check loading by UUID
|
||||
if (CommandUtils.unloadedProfile(sender, profile)) {
|
||||
|
Reference in New Issue
Block a user