Saved player name changes

This commit is contained in:
Auxilor
2021-11-08 10:58:18 +00:00
parent a6f139c47e
commit 7d38d7db15
3 changed files with 18 additions and 3 deletions

View File

@@ -90,7 +90,17 @@ public class PlayerUtils {
profile.write(PLAYER_NAME_KEY, onlinePlayer.getDisplayName());
}
return profile.read(PLAYER_NAME_KEY);
String saved = profile.read(PLAYER_NAME_KEY);
if (saved.equals(PLAYER_NAME_KEY.getDefaultValue())) {
String name = player.getName();
if (name != null) {
profile.write(PLAYER_NAME_KEY, player.getName());
return player.getName();
}
}
return saved;
}
/**