Fix legacy skull texture profile normalization#4960
Conversation
Normalize legacy skull texture profile data when translating to newer versions. Some legacy skulls can contain texture values with missing Base64 padding. Older authlib versions tolerated this, but newer clients reject the payload during skin loading. Normalize only the textures property by removing whitespace and restoring safe missing padding during the 1.15.2->1.16 skull owner rewrite path. Also omit empty texture signatures when converting profile data. An empty signature is not a valid signature and causes modern clients to attempt verification and log errors; treating it as absent preserves unsigned texture behavior.
|
Do you have example commands/chunk data/inventory data for such skulls to test with? |
Move fix from 1.16 to 1.18 since that is where the issue actually begins. Previously, a player using 1.18 playing on a 1.17 server could still bump into this issue.
|
Just a heads up, most of my testing was done on a 1.12 server swapping back and forth between a 1.12 and 26.1 client, but the issue is present on clients 1.18+. Texture Signature IssueI was able to test this with this command: /give @p minecraft:skull 1 3 {SkullOwner:{Id:"dcfab6a7-8467-4338-8787-af7245c3d31e",Properties:{textures:[{Value:"ewogICJ0aW1lc3RhbXAiIDogMTc4MDg1MzU4MDI2NSwKICAicHJvZmlsZUlkIiA6ICJkY2ZhYjZhNzg0Njc0MzM4ODc4N2FmNzI0NWMzZDMxZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJJdHNMaWxTY29ycCIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8zMTcwNWE1YWE3ZDgwMDYwM2E2OWM3MmZlOTMxYWRhZWQ3MDJlNTE4NjJhNjE2ZTcwY2Q4NzU2M2I3ZTY5YmI2IgogICAgfSwKICAgICJDQVBFIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9kYmMyMWUyMjI1MjhlMzBkYzg4NDQ1MzE0ZjdiZTZmZjEyZDNhZWViYzNjMTkyMDU0ZmJhN2UzYjNmOGM3N2IxIgogICAgfQogIH0KfQ==",Signature:""}]}}}In both versions, the skull renders properly as expected, but on 26.1 without this patch, I receive this error in my console: Console OutputThe error no longer shows up with this patch. Base64 Padding IssueI first noticed this issue on an external 1.12 server while using ViaFabricPlus, but it is replicable on 1.18 using that server's built-in ViaVersion. I've listed the server and location in case you would like to see for yourself. Note that, in my testing, if I loaded the texture properly on 1.12, it would get cached and correctly load across other versions as well until I restarted my PC. Very annoying for testing. This is the 1.12 data for one of the impacted skulls in question: {Owner:{Id:"23f58a2e-f6a6-b008-2c1c-768cd0898fe3",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA2ZDI3YjgzNGRiOGE4Mzc0ZDQxYmUzYWI5NjNlZWZiZjc1NWIwZGMwYzljOGViMTg3MDJlYWZkODMwZTQxZiJ9fX0="}]}},Rot:0b,x:-344,y:66,z:-531,id:"minecraft:skull",SkullType:3b}On newer versions without this patch, this skull gets translated to this: {id:"minecraft:player_head",count:1,components:{"minecraft:profile":{id:[I;785466496,-92448722,1080509230,264963125],properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmE2M2M0NGJmMWE4NDg5NGQwNDQ1N2NjNzhhMzdlYjkwNWE3NmQzNjlhZmViNzdmOGM4ZmZhYzMwMmYxMjMyIn19fQ="}]}}}While accurate to the original data, the base64 data is broken since it is missing an extra Console OutputThis patch fixes this making the skull get translated to this: {id:"minecraft:player_head",count:1,components:{"minecraft:profile":{id:[I;785466496,-92448722,1080509230,264963125],properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmE2M2M0NGJmMWE4NDg5NGQwNDQ1N2NjNzhhMzdlYjkwNWE3NmQzNjlhZmViNzdmOGM4ZmZhYzMwMmYxMjMyIn19fQ=="}]}}}This fixes the base64 issue and correctly allows the skull to load on the server. The ProblemI could not find a way to replicate this issue on a localhost server. No matter what I did to generate the exact same skull, including give commands as well as downloading the original server world, the skulls just loaded as expected. So, I'm not sure what on that server is causing broken skulls to load sometimes and not load other times, I just know that it's solved here. Also, this was originally implemented into the 1.15.2 -> 1.16 conversion, but I have moved it to 1.17.1 -> 1.18 since the issue affects 1.18+ clients and the prior implementation could let the issue slip through when playing on 1.16-1.17.1 servers. |

What changed
This PR normalizes legacy skull texture profile data in two cases:
texturesprofile values during the1.15.2 -> 1.16skull owner rewrite path.Why
Some legacy skulls from older servers contain texture values that older authlib versions accepted, but newer clients reject with:
In testing, affected values were missing Base64 padding, for example length
179withmod4=3, while working values were length180with padding.Modern clients can also spam the client's log with signature verification errors when a texture property contains an empty signature string:
An empty string is not a valid signature. Treating it as absent preserves unsigned texture behavior and avoids the invalid-signature path.
Scope
The Base64 normalization is limited to skull profile
texturesvalues crossing the1.15.2 -> 1.16rewrite path, covering both skull items and skull block entities.Valid signatures and already valid texture values are preserved.
AI was used to help investigate the issue and prepare the patch. The behavior was reproduced and the resulting change was manually tested.