[SPIGOT-3553] Make SkullMeta methods use UUID instead of player name and add getter/setter for texture Created: 06/Sep/17 Updated: 07/Sep/17 Resolved: 06/Sep/17 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | vcdf | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The SkullMeta class hasn't been updated for years and now has two flaws:
This is the NBT tag of an example player head item (generated using this website): {display:{Name:"Notch Head"},SkullOwner:{Id:"d220a6b0-d62b-4112-96d6-a1b1846d275a",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTExNmU2OWE4NDVlMjI3ZjdjYTFmZGRlOGMzNTdjOGM4MjFlYmQ0YmE2MTkzODJlYTRhMWY4N2Q0YWU5NCJ9fX0="}]}}}
My suggestions: 1) Add a method boolean setOwner(UUID owner) This method would change the SkullOwner's UUID. 2) Add a method UUID getOwner() This method would return the SkullOwner's UUID. 3) Add a method boolean setTexture(String texture) The method would put the texture parameter into the NBT tag's Value field and change the SkullOwner UUID to a new random one. 4) Add a method String getTexture() This method would return the current texture of the player head. 5) Deprecate boolean setOwner(String owner) and String getOwner()
These changes would make player skulls namechange-proof and would allow modifying a skull's texture without the texture being used as skin by a Minecraft account. Additionally, the Skull block state class could get methods similar to 3) and 4).
|
| Comments |
| Comment by vcdf [ 07/Sep/17 ] |
|
There is never a 100% guarantee, Mojang removes functionailty all the time. Mojang employees saying they won't remove it is as guaranteed as it can get. |
| Comment by md_5 [ 07/Sep/17 ] |
|
I'm referring to when they stopped accepted skins that didn't have a valid and matching signature. |
| Comment by vcdf [ 06/Sep/17 ] |
|
Dinnerbone has described the official way to create player heads with custom textures: Right now, if we want our plugin to create a player head with a custom texture, we need to own a seperate Minecraft account for each texture and we can never change its skin because then heads created by the plugin would also use the new texture. With the new methods I proposed, we could temporarily upload the skin to an account, grab the base64 encoded texture url and the head would be guaranteed to never change its texture because Mojang stores all past skins forever (https://www.reddit.com/r/Minecraft/comments/2qkbsz/i_recently_discovered_that_you_can_make_unlimited/cn6wfm5/). |
| Comment by md_5 [ 06/Sep/17 ] |
|
I do not think skin spoofing is something Mojang condones, and it is something they have blocked in the past (1.7.x) |
| Comment by vcdf [ 06/Sep/17 ] |
|
The structure of the NBT tag hasn't changed since 1.8 (when custom textures were introduced). Mob heads with custom textures are being used in many projects by the community (for example https://xisumavoid.com/moremobheads/), so I don't think Mojang is going to remove that functionality. |
| Comment by md_5 [ 06/Sep/17 ] |
|
Theres another ticket about that, but I don't think its likely to be a stable api |
| Comment by vcdf [ 06/Sep/17 ] |
|
Thanks for the fix @md_5 |