SportBukkit
SportBukkit copied to clipboard
Fix skull items not displaying skins
In 1.8, they added player skull previews to the inventory item. Currently, if you use SkullMeta in order to have a custom SkullOwner, it'll appear in the inventory as a steve skin (it looks like the SkullOwner when placed down though). This patch uses TileEntitySkull.b() to update the skin, and it won't update skin inventory items if it is disabled in bukkit.yml (fetch-skulls) because of the base b method.
Before patch:
After patch:
The skulls in the screenshots use the same method (SkullMeta setSkullOwner()), and both have the fetch-skulls setting enabled in bukkit.yml. Thanks.
So this PR respects the fetch-skins
setting? These skins are populated when the world (er, chunk) is loaded?
Yes, if fetch-skins is set to false, it won't render the skins. It looks like this:
The skins are loaded when they're called in the SkullMeta.
There are a few lines that remove this
which is unnecessary.
Sorry about that, wasn't sure if it was necessary as I wanted it the same throughout. I'll see if I can fix it later.
@tonybruess @jedediah Would it be possible to get this merged? I'd like to file a PR after this gets merged to expand on the current Skull API to support setting Skull owners by UUID rather than only by usernames.
If the unnecessary diffs get fixed, I'll merge it.
Feel free to do whatever with this patch. I don't even know if I have the code anymore. I didn't look hard, but maybe you could find what Spigot used to fix this as theirs works.
@ShinyDialga If you're cool with this, I can file a new PR with these changes + diffs and also take a look at how Spigot fixes this issue, this weekend.
Go for it