The setGameProfile method on TileEntitySkull is annotated with the @nullable annotation,
but the skull didn't check for null profiles before attempting to retrieve cached skin.
This bug was introduced by the commit making the skull use spigot's User Cache.
Additionally, CraftMetaSkull also had the same issue with a null GameProfile, so this also
ensures it doesn't break.
The whole CraftPlayerProfile class is not null-safe, it requires a GameProfile that isn't
null so we add a Validation on the constructor, that way it is easier to catch this kind
of issue in the future.
Spigots cache only cached by name which really was not correct...
Additionally, user cache exposes a cache of any player who has logged in
once this session too even if offline.
Also fixed some quirks with Profile API where we might of had textures
in the cache that we didn't even try to look up.
So this should overall help reduce API calls to Mojang.
Sadly, the User Cache doesn't cache textures, but if that ever
changes in future, we would gain benefit there too.
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
da9ef3c5 #496: Add methods to get/set ItemStacks in EquipmentSlots
3abebc9f #492: Let Tameable extend Animals rather than Entity
941111a0 #495: Expose ItemStack and hand used in PlayerShearEntityEvent
4fe19cae #494: InventoryView - Add missing Brewing FUEL_TIME
CraftBukkit Changes:
933e9094 #664: Add methods to get/set ItemStacks in EquipmentSlots
18722312 #662: Expose ItemStack and hand used in PlayerShearEntityEvent
2020-05-06 06:05:22 -04:00
Renamed from Spigot-Server-Patches/0192-Add-setPlayerProfile-API-for-Skulls.patch (Browse further)