PaperMC / PaperMC/Paper

PlayerProfile#complete does not fill the profile name when given a UUID

Open
#8,927 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted type: bug
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When calling PlayerProfile#complete, it should fill both name and textures is supplied with a uuid.

Observed/Actual behavior

the textures will be filled after complete is called.
the profile name will be null, you need to call update to make a second api call to fill the name, even though when printing the textures, it shows the name.

Steps/models to reproduce
PlayerProfile profile = Bukkit.createProfile(UUID.fromString("b03e2273-140b-4990-bc94-fd9350414d71"));
profile.complete();

System.out.println("name: " + profile.getName()); // null, even though the name is given in the textures
System.out.println("id: " + profile.getId()); // b03e2273-140b-4990-bc94-fd9350414d71
System.out.println("textures: " + profile.getTextures()); // will return textures

profile.update().thenAccept(updated -> { //Makes a SECOND api call to get the name
    System.out.println("name after update: " + updated .getName()); // Kalcite
});
Plugin and Datapack List

none

Paper version

git-Paper-431 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: e574412)

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PlayerProfile#complete and PlayerProfile#update implementations, then reproduce the UUID case from the issue. Trace how the returned textures contain the profile name and verify that complete also populates getName without requiring the second update call.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.