Repository navigation
Conversation
Skull profiles without textures trigger a Mojang lookup on every build, which never succeeds for offline-mode UUIDs. Use the player's own profile instead and keep setOwningPlayer only for v4 UUIDs.
CyR1en
left a comment
There was a problem hiding this comment.
Thanks for this. I checked the diagnosis against the Paper 26.1.2–26.3 sources and it holds: CraftMetaSkull.applyToItem calls update() whenever the owner profile has no skin/cape, that goes straight to an uncached fetchProfile(uuid, true), and Mojang answers 204 for v3 UUIDs. It is actually worse than described, because GuiItem.applyUUID() re-applies the meta on every GUI render.
Requesting changes for one regression:
Plain heads can't be selected. PlayerUIScreen identifies the clicked player with skullMeta.getOwningPlayer() (PlayerUIScreen.java:132-134). The new plain head has no owner, so clicking an untextured non-v4 player does nothing. applyFirstFilterFormat (lines 261-263) has the same dependency, so filter formats are skipped for those heads too. Both reproduce in MockBukkit with a v3 player and pass on development. CI misses it because the default mock players get random v4 UUIDs.
Suggested fix: write the player name (or UUID) to the head's PDC in createHead and read that in both places, with tests using a v3 untextured player.
Smaller points:
hasTextureschecks for a non-empty property, but the server triggers on "no skin and no cape URL".!profile.getTextures().isEmpty()mirrors it exactly.cacheanduntexturedare updated in two steps (invalidate,clear), which can drop a marker under Folia. A single map with a(item, textured)value would remove the invariant, or usesynchronized (cache).untextured.addhappens before the build completes, so an exception leaves a marker with no entry.- On real Paper,
setOwningPlayer(Player)already uses the live profile, so the textured branch is behaviour-neutral. Worth saying in the description that the effective change is the plain-head branch. - Nits:
createHeadreturns null from anOptionalmethod; the map can no longer holdOptional.empty(); the Javadoc says "version 3" but the check is "not version 4".
Optional follow-up: compare the cached textures value with the live one so mid-session skin changes are picked up as well.
Store the owner name in the head's PDC, mirror the server's skin/cape check, keep head and textures key in one entry and rebuild on skin change.
|
Thanks for the thorough review. Pushed 7a9d8e5:
I also updated the description: on real Paper the textured branch is behaviour-neutral, the effective change is the plain-head branch. |
Uh oh!
There was an error while loading. Please reload this page.