Skip to content

Commit

Permalink
Fix #977 (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean authored and aramperes committed Nov 18, 2018
1 parent afcfe1c commit e7b4a20
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class GlowPlayerProfile implements PlayerProfile {

public static final int MAX_USERNAME_LENGTH = 16;
@Getter
@Nullable
private final String name;
@Nullable
private volatile CompletableFuture<UUID> uniqueId;
private final Map<String, ProfileProperty> properties;

Expand Down Expand Up @@ -191,8 +193,13 @@ public static GlowPlayerProfile fromJson(JSONObject json) {
*/
public CompoundTag toNbt() {
CompoundTag profileTag = new CompoundTag();
profileTag.putString("Id", uniqueId.toString());
profileTag.putString("Name", name);
UUID uuid = getId();
if (uuid != null) {
profileTag.putString("Id", uniqueId.toString());
}
if (name != null) {
profileTag.putString("Name", name);
}

CompoundTag propertiesTag = new CompoundTag();
for (ProfileProperty property : properties.values()) {
Expand Down

0 comments on commit e7b4a20

Please sign in to comment.